public ResponseInfo ContextTimeout(Context context) { var response = new ResponseInfo(null, null); lock (_locker) { if (context == _waiting) { response.Context = _waiting; _waiting = null; if (_packets.Count > 0) { response.Packet = _packets.Peek(); } } } return(response); }
public ResponseInfo FinishWaiting() { var response = new ResponseInfo(null, null); lock (_locker) { if (_waiting != null) { response.Context = _waiting; _waiting = null; if (_packets.Count > 0) { response.Packet = _packets.Peek(); } } } return(response); }
private void Send(ResponseInfo response) { Send(response.Context, response.Packet); }