PDA

Click to See Complete Forum and Search --> : Client/Server


Frogsquasher
Jul 12th, 2005, 04:45 PM
If I want to listen for a connection from my server, to my client... do I need a new winsock thing, or can I use the same one that is sending the data to the server?

also, how would i do this?

Thanks,
Frogsquasher

ccoder
Jul 13th, 2005, 08:25 AM
The server is the only one that listens for a connection request. The client sends a connect request, and once connected can send and receive data until one side or the other closes the connection.

The server can use the same control to listen and connect, but the best approach is to use an array of winsock controls and pass the connecting & data communication off to one of the other controls in the array.

There are examples of both approaches at http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconusingwinsockcontrol.asp