probleme with winsock

Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Sep 2007
Posts: 1
Reputation: Guismay is an unknown quantity at this point 
Solved Threads: 0
Guismay Guismay is offline Offline
Newbie Poster

probleme with winsock

 
0
  #1
Sep 2nd, 2007
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.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the Pascal and Delphi Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC