[RESOLVED] Synchronous socket
Hi,
My question will seem a little bit stupid, but i been searching for hours on how to create a socket that will conect to a server and send data synchronously. I'm using the mfc CSocket class and when i check with tcpSpy i get this data :
Quote:
socket (560) created [family=AF_INET, type=SOCK_STREAM, protocol=IPPROTO_IP, dwFlags=WSA_FLAG_OVERLAPPED]
socket (560) requested message-based event notification and enabled its nonblocking mode [hWnd=160758, wMsg=883, lEvent=FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE]
socket (560) bound [name=0.0.0.0]
socket (592) created [family=AF_INET, type=SOCK_STREAM, protocol=IPPROTO_IP, dwFlags=WSA_FLAG_OVERLAPPED]
socket (592) requested message-based event notification and enabled its nonblocking mode [hWnd=160758, wMsg=883, lEvent=FD_READ|FD_WRITE|FD_OOB|FD_ACCEPT|FD_CONNECT|FD_CLOSE]
socket (592) bound [name=0.0.0.0]
socket (560) connecting asynchronously [name=x.x.x.x:8080]
socket (592) connecting asynchronously [name=x.x.x.x:8081]
socket (560) receiving data synchronously without blocking [len=256]
socket (560) could not receive data - WSAENOTCONN (A request to send or receive data was disallowed because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied)
socket (592) closed; bytes received=0, bytes sent=0
socket (560) closed; bytes received=0, bytes sent=0
Thanks