Skip to main content
GameDev.net gamedev.net
🔒 Locked

[.net] TcpClient rules

Started by Cybrosys Oct 9, 2006 at 5:57 AM 0 replies 800+ views
Original Post
Cybrosys
Cybrosys
Does anyone know if a TcpClient's NetworkStream closes the connection if a packet fails to be delivered, that is, even if resend fails that's built-in to the tcp protocol.
BradSnobar
BradSnobar
I once asked this sort of question to the networking gurus at a game shop.
Basically, they said that if this happens then there are bigger problems to worry about.

In essence the answer became, catch an exception (probably a system.io.ioexception) to this effect and try to establish the connection again, or wait for the connection to re-establish from the client.

There are like 60 possible lame situations that can happen to cause problems across the network, and it is hard to make it a reliable connection.

But, if you really want to know...here is a test you might try

write an app that sends data across the wire
repeat
send a small amount of data
sleep for a little bit
until done
then pull the network cable and plug it back in.

As a side note, tcp is supposed to garuntee a packet is received, like you said, resending packets and such.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.