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
19
19
along with this program. If not, see <http://www.gnu.org/licenses/>.
20
20
*/
21
21
22
+ using System ;
22
23
using System . Diagnostics ;
23
24
using System . Net . Sockets ;
24
25
using NetMQ . Core . Utils ;
@@ -208,8 +209,17 @@ public bool TryRecv(int timeout, out Command command)
208
209
return true ;
209
210
210
211
// 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
+ }
213
223
}
214
224
215
225
// Wait for signal from the command sender.
You can’t perform that action at this time.
0 commit comments