private void _server_OnReceive(object userToken, byte[] data) { var ut = (IUserToken)userToken; var up = (MyUnpacker)ut.Unpacker; up.Unpack(data, (package) => { OnReceived?.Invoke(package); _server.SendAsync(ut.ID, up.Process(package)); }); }
/// <summary> /// 回复 /// </summary> /// <param name="userToken"></param> /// <param name="msg"></param> internal void Reply(IUserToken userToken, RSocketMsg msg) { var data = ((RUnpacker)userToken.Unpacker).Encode(msg); _server.SendAsync(userToken.ID, data); }
public void SendData(byte[] data) { _dataSocket.Start(); _autoResetEvent1.WaitOne(); _dataSocket.SendAsync(_id, data); }
private void _classificationBatcher_OnBatched(string id, byte[] data) { _server.SendAsync(id, data); }