File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ You should have received a copy of the GNU Lesser General Public License
1919 along with this program. If not, see <http://www.gnu.org/licenses/>.
2020*/
2121
22+ using System ;
2223using System . Diagnostics ;
2324using System . Net . Sockets ;
2425using NetMQ . Core . Utils ;
@@ -208,8 +209,17 @@ public bool TryRecv(int timeout, out Command command)
208209 return true ;
209210
210211 // If there are no more commands available, switch into passive state.
211- m_active = false ;
212- m_signaler . Recv ( ) ;
212+ try
213+ {
214+ m_active = false ;
215+ m_signaler . Recv ( ) ;
216+ }
217+ catch
218+ {
219+ m_active = true ;
220+ command = default ( Command ) ;
221+ return false ;
222+ }
213223 }
214224
215225 // Wait for signal from the command sender.
You can’t perform that action at this time.
0 commit comments