| | |
probleme with winsock
Please support our Pascal and Delphi advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Sep 2007
Posts: 1
Reputation:
Solved Threads: 0
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 :
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 :
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.
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)
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 :
Pascal and Delphi Syntax (Toggle Plain Text)
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
- Winsock Multi-Client Servers (C++)
- dxsetu, winsock and other nasty things I cant get rid of (Viruses, Spyware and other Nasties)
- Dxsetu.exe, winsock.scr, ope50.exe - Errors (Viruses, Spyware and other Nasties)
Other Threads in the Pascal and Delphi Forum
- Previous Thread: help with creating arrays
- Next Thread: File transfer
| Thread Tools | Search this Thread |





