Quantcast
Channel: #Zyan Communication Framework
Viewing all articles
Browse latest Browse all 665

Edited Issue: [en] TcpEx: retry settings are ignored [2001]

$
0
0
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.

Viewing all articles
Browse latest Browse all 665

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>