hi all,
just a stupid question:
if i create a socket and do "connect" to a XX.YYY.ZZZ.WWW address, when i've finish to comunicate, could i just close the connection without closing the socket and then connect to another address using the same open socket ?
THX B7
just a stupid question:
if i create a socket and do "connect" to a XX.YYY.ZZZ.WWW address, when i've finish to comunicate, could i just close the connection without closing the socket and then connect to another address using the same open socket ?
THX B7
Yes, u can reuse the socket handle, I've done it before.
ok, but how ?????
I should just do another "connect" and this automatically terminate the previous connection ?
I should just do another "connect" and this automatically terminate the previous connection ?
Once you are finished with the first connection, just terminte it using the "closesocket" function. Once this is done, then you just call the "connnect" function again, passing the same socket handle.
Once you are finished with the first connection, just terminte it using the "closesocket" function. Once this is done, then you just call the "connnect" function again, passing the same socket handle.
The PSDK doesn't agree with you:
The closesocket function closes a socket. Use it to release the socket descriptor s so that further references to s fail with the error WSAENOTSOCK.
Thomas
sorry but i don't think i cac use closesocket anyway, i was using sockets with linux and i don't see this function as available :(
THX anyway, @ the moment i'm closing and recreating the socket.
THX anyway, @ the moment i'm closing and recreating the socket.
The function closesocket is the windows equalent for close, when using on sockets.
It's because on windows, socket handles are not equal to file handles.
-Stealth
It's because on windows, socket handles are not equal to file handles.
-Stealth