Skip to content

Commit e98aa4a

Browse files
authored
Merge pull request #719 from mikepmiller/Issue716
Issue716
2 parents b90e7f6 + b547817 commit e98aa4a

File tree

2 files changed

+15
-2
lines changed

2 files changed

+15
-2
lines changed

AUTHORS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@ Contributors
2424
* Dale Brubaker — [@dalebrubaker](https://github.com/dalebrubaker)
2525
* Calin Pirtea — [@pcalin](https://github.com/pcalin)
2626
* Osiris Pedroso — [@opedroso](https://github.com/opedroso)
27+
* Mike Miller — [@mikepmiller](https://github.com/mikepmiller)

src/NetMQ/Core/Transports/Pgm/PgmSession.cs

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,19 @@ public void Terminate()
6868
public void BeginReceive()
6969
{
7070
m_data.Reset();
71-
m_handle.Receive((byte[])m_data);
71+
try
72+
{
73+
m_handle.Receive((byte[])m_data);
74+
}
75+
catch (SocketException ex)
76+
{
77+
// For a UDP datagram socket, this error would indicate that a previous
78+
// send operation resulted in an ICMP "Port Unreachable" message.
79+
if (ex.SocketErrorCode == SocketError.ConnectionReset)
80+
Error();
81+
else
82+
throw NetMQException.Create(ex.SocketErrorCode, ex);
83+
}
7284
}
7385

7486
public void ActivateIn()
@@ -223,4 +235,4 @@ public void ActivateOut()
223235
DropSubscriptions();
224236
}
225237
}
226-
}
238+
}

0 commit comments

Comments
 (0)