954,202 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

probleme with winsock

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 :

CloseSocket(sock);
  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 :

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.

Guismay
Newbie Poster
1 post since Sep 2007
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You