Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Csocket response problems - specialist needed

Status
Not open for further replies.

bubak

Programmer
Jun 25, 2001
208
SK
If I create a Listening socket and afterr other client Socket connected, I do accept(socket2)
I have connection
socket2------clientSocket

When I send messages from clientSocket 2 seocket2, and nothing more and i send less than each 200 ms, it crashes, but, when I after each Received Cstring on socket2 do a RESPONSE, I can send each 2 ms, and it works fine.
Why could that be?
thx
bubo
 
Hi,
I've never used Csockets in VC++ before but I have used the Winsock active X component successfully and also original Berkley sockets on an OS9 based embedded system.

I am not sure quite what you are trying to do here. However unless you are a server that is going to spawn a new process each time a client makes a new connection you need to CLOSE THE LISTENING PORT BEFORE YOU ACCEPT A NEW CONNECTION TO THE REQUESTING CLIENT.
 
I use the way, that server is listening on port 1234, when a connection appears from client:client_port, i create new socket sock1 at a high port on server and the connection is between sock1---client, so listening port is free for new connections.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top