Original Post
I'm having problems reconnecting nonblocking tcp sockets bound to the same source port... (winsock using standard Berkeley calls) sorry I'll backup & try & make more sense: When the socket is first created I allow winsock so assign me a free port I then save the assigned port & set the socket into nonblocking mode The first connect() on this socket always succeeds After the connection succeeds & is ended (or fails) the socket is closed Another socket is then immediately created in its place & assigned the same port & attempts to connect() to the same host (& target port) again Now sometimes this works fine & the sockets establish their connections, receive the allotted packets, disconnect, then repeat But other times the source port seems to become invalidated after the first connect() & all later socket connects bound to the same source port will fail with an eventual connect() timeout This socket invalidation only seems to occour directly after the first connect 99% of the time (it does occasionally occour after several, but this is highly rare) All winsock socket calls are fully error checked & it reports no problem whatsoever on rebinding of the same port, nor should it I believe The server is in a blocking accept loop & receives no input whatsoever while the client slowly times out with its connect() call
If anyone has experienced these symptoms before or feels they could shed some light on this it would be fully appreciated oh btw: all sockets (client & server) are currently being shutdown() with SD_BOTH prior to closesocket() & are being closed serverside [Edited by - ProPuke on June 24, 2005 3:58:02 PM]
If anyone has experienced these symptoms before or feels they could shed some light on this it would be fully appreciated oh btw: all sockets (client & server) are currently being shutdown() with SD_BOTH prior to closesocket() & are being closed serverside [Edited by - ProPuke on June 24, 2005 3:58:02 PM]