PDA

Click to See Complete Forum and Search --> : winsock api


dungism
Dec 31st, 1999, 01:54 PM
hi, i've managed to connect and send data with winsock.dll functions. Then i ran into a few problems... I am making a very simple *****peer chat. My server listen on certain port and client connect to that port. Now, I am trying to send data back and forth, but then I wonder. Should I keep that socket alive and transfer with that socket(if it's possible), or create new socket everytime I press send? And also, for my server, I tried to use a timer with recv() to see if I got data, then it froze. Are there any other ways to notice the incomming data from client?? Please help me out!!!!!!!

B4
Dec 31st, 1999, 09:20 PM
It is possible to send and receive data with the same socket. It is also possible to notice incoming data from the client. Since you topic is "winsock api" I am assuming you are not using the winsock control. To see if you are receiving data you must make the socket listen on thay port, and read data on the event of data being received. I wrote a tutorial earlier on this if you are interested, it is located at http://codeseek.selfhost.com/tutorials/vb/winsockapi1.shtml

-B4