Re: Reconnecting to a socket
From: Alexander Nickolov (agnickolov_at_mvps.org)
Date: 12/25/04
- Previous message: Alexander Nickolov: "Re: Strange problem drive me mad."
- In reply to: Andrew Chalk: "Reconnecting to a socket"
- Next in thread: Andrew Chalk: "Re: Reconnecting to a socket"
- Reply: Andrew Chalk: "Re: Reconnecting to a socket"
- Reply: Andrew Chalk: "Re: Reconnecting to a socket"
- Reply: Andrew Chalk: "Re: Reconnecting to a socket"
- Messages sorted by: [ date ] [ thread ]
Date: Sat, 25 Dec 2004 13:47:08 -0800
Can't say for sure what are you doing, but it sounds like
you are mixing up the listening and accepted sockets.
You are supposed to be listening continuously on the
listening socket. When a connection arrives you should
accept it and continue listening right away. The accepted
socket carries out all communication with the client, the
listening socket carries no data.
-- ===================================== Alexander Nickolov Microsoft MVP [VC], MCSD email: agnickolov@mvps.org MVP VC FAQ: http://www.mvps.org/vcfaq ===================================== "Andrew Chalk" <achalk@XXXmagnacartasoftware.com> wrote in message news:%23tqjhHj6EHA.2124@TK2MSFTNGP15.phx.gbl... >I have written a Winsock client/server application. When the client is > finished it issues a closesocket(). If I run it again it gets an > FD_CONNECT > from the server with NetworkEvents.lNetworkEvents = 0. However, the server > never gets any events (I am expecting at least an FD_ACCEPT) . > > When a connecting client disconnects from a listening server is there > something that the server should do in order to hear new connection > attempts? I have issuing bind() again (error) and listen() again() (return > code success) to no avail. The listening server never hears new connection > attempts. > > Many thanks. > >
- Previous message: Alexander Nickolov: "Re: Strange problem drive me mad."
- In reply to: Andrew Chalk: "Reconnecting to a socket"
- Next in thread: Andrew Chalk: "Re: Reconnecting to a socket"
- Reply: Andrew Chalk: "Re: Reconnecting to a socket"
- Reply: Andrew Chalk: "Re: Reconnecting to a socket"
- Reply: Andrew Chalk: "Re: Reconnecting to a socket"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|