private void OnSessionError(int opaque, long sessionId, string remoteEndPoint, int errorCode, string errorText) { SocketError sprotoSocketError = new SocketError(); sprotoSocketError.errorCode = errorCode; sprotoSocketError.errorText = errorText; sprotoSocketError.connection = sessionId; sprotoSocketError.remoteEndPoint = remoteEndPoint; Message msg = new Message(); msg.Source = 0; msg.Destination = opaque; msg.Method = "SocketError"; msg.Data = sprotoSocketError.encode(); msg.RPCSession = 0; msg.Type = MessageType.Socket; ServiceContext service = ServiceSlots.GetInstance().Get(opaque); service.Push(msg); }