Duplex channel has MaxRetries and RetryDelay properties:
https://zyan.codeplex.com/SourceControl/changeset/11626
But they are completely ignored when the connection is first established:
```c#
// Connection.cs, line 215
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.Connect(new IPEndPoint(remoteIPAddress, _socketRemotePort));
CheckSocket();
```
_socket.Connect throws SocketException, so we never reach the CheckSocket() method.
I'm not sure if we should retry when the connection is first established, but I'd definitely prefer that.
Also, CheckSocket() doesn't seem to work as expected:
```c#
// Connection.cs, line 376
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.Connect(new IPEndPoint(remoteAddress, _socketRemotePort));
try
{
success = SendChannelInfo() && ReceiveChannelInfo();
}
catch (SocketException)
{
success = false;
}
```
We don't reach the try...catch statement because _socket.Connect throws an exception.
And we don't close the socket properly when the exception is thrown.
https://zyan.codeplex.com/SourceControl/changeset/11626
But they are completely ignored when the connection is first established:
```c#
// Connection.cs, line 215
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.Connect(new IPEndPoint(remoteIPAddress, _socketRemotePort));
CheckSocket();
```
_socket.Connect throws SocketException, so we never reach the CheckSocket() method.
I'm not sure if we should retry when the connection is first established, but I'd definitely prefer that.
Also, CheckSocket() doesn't seem to work as expected:
```c#
// Connection.cs, line 376
_socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
_socket.Connect(new IPEndPoint(remoteAddress, _socketRemotePort));
try
{
success = SendChannelInfo() && ReceiveChannelInfo();
}
catch (SocketException)
{
success = false;
}
```
We don't reach the try...catch statement because _socket.Connect throws an exception.
And we don't close the socket properly when the exception is thrown.