Skip to content

Commit

Permalink
Fix | Fix TCP Keep Alive missing call (#855)
Browse files Browse the repository at this point in the history
  • Loading branch information
cheenamalhotra authored Dec 18, 2020
1 parent dbd7a4b commit f8c274f
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,10 @@ void Cancel()
if (ipAddresses[i] != null)
{
sockets[i] = new Socket(ipAddresses[i].AddressFamily, SocketType.Stream, ProtocolType.Tcp);

// enable keep-alive on socket
SetKeepAliveValues(ref sockets[i]);

sockets[i].Connect(ipAddresses[i], port);
if (sockets[i] != null) // sockets[i] can be null if cancel callback is executed during connect()
{
Expand Down

0 comments on commit f8c274f

Please sign in to comment.