I inherited code that calls the following:
TcpClient client;
// (removed try/catch blocks to simplify this discussion)
client = new TcpClient
{
SendTimeout = 5000,
ReceiveTimeout = 5000
};
client.Connect( hostName, port );
tcpClient.ReceiveTimeout = 20000;
tcpClient.SendTimeout = 20000;
tcpClient.Client.Send( someByteArray );
My question is why the Send/Receive timeouts would be set twice. Isn't it true that Connect isn't affected by those properties anyway? Am I missing something here? We got a SocketError.TimedOut exception on our Connect, but I don't think it has anything to do with hte timeout settings.