944,016 Members | Top Members by Rank

Ad:
Sep 2nd, 2007
0

probleme with winsock

Expand Post »
Hello,

I have created two applications, a client and a server.
I created a multi transfer system, with Winsock, but there is a little problem again.

For the transfer, I created 2 threads (one in the client and one in the server).

During the transfer, the server use one TCP port, and the status of the connection was "Etablished".
In the server, it is the same thing, I have a connection on "Etablished", but I have also an other connection on "Listening".

When the download (or upload) is complete, the thread make this :

Pascal and Delphi Syntax (Toggle Plain Text)
  1. CloseSocket(sock);
  2. WSACleanUP;

and close itself.

Now, my problem is that the connection of the client who was on "Listening" was always here, I didn't manage to remove it

I think it is because this code :

Pascal and Delphi Syntax (Toggle Plain Text)
  1. If (Listen(Sock, SOMAXCONN) <> 0) Then Goto Disconnected;


but for me the closesocket should close it :s

Is there a function which allow me to close the connection listening ?
Do you have an idea to stop this ?

Thank you for your help.
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
Guismay is offline Offline
1 posts
since Sep 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Pascal and Delphi Forum Timeline: help with creating arrays
Next Thread in Pascal and Delphi Forum Timeline: File transfer





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC