public override void SendRawData(CTSMarker ctsMarker, MsgPrefix msgNote, byte[] protoBytes) { if (m_LcrsService != null) { if (msgNote.MsgID == (UInt16)eMsgID.S2C_RadianceStream) { LCRS.Log("==================================================== Send data with: " + protoBytes.Length); if (m_SessionDataBufferMap.ContainsKey(ctsMarker.sessionId) == false) { m_SessionDataBufferMap.Add(ctsMarker.sessionId, new AccumDataBuffer(m_LcrsService, ctsMarker.sessionId)); } m_SessionDataBufferMap[ctsMarker.sessionId].PushData(protoBytes); } else if (((eMsgID)msgNote.MsgID).ToString().Contains("Json")) { LCRS.Log("==================================================== Send data with: " + protoBytes.Length); m_LcrsService.Sessions.SendTo(ctsMarker.sessionId, protoBytes); } //m_LcrsService.Sessions.SendToAsync(ctsMarker.sessionId, protoBytes, SendAsyncCompleted); // Debug: save the file //string strSaveFile = Application.dataPath + "/rt_" + System.DateTime.Now.Minute + "_" + System.DateTime.Now.Second + "_web.png"; //FileStream fs = File.Open(strSaveFile, FileMode.Create); //fs.Write(protoBytes, 0, protoBytes.Length); //fs.Close(); } }
public static void SendRawData(CTSMarker ctsMarker, MsgPrefix msgNote, byte[] protoBytes) { if (m_Server != null) { m_Server.SendRawData(ctsMarker, msgNote, protoBytes); } }
public override void SendRawData(CTSMarker ctsMarker, MsgPrefix msgNote, byte[] protoBytes) { msgNote.msgSize = (ushort)(ctsMarker.tcpSocket.MsgPrefixLength + (protoBytes != null ? protoBytes.Length : 0)); ctsMarker.tcpSocket.SendData(msgNote, protoBytes); LCRS.Log("================================================= Send data to client"); }
public static byte[] PackMsgHeader(MsgPrefix msgNote, byte[] data) { byte[] header = BitConverter.GetBytes((int)msgNote.MsgID); byte[] tmp = new byte[header.Length + data.Length]; System.Buffer.BlockCopy(header, 0, tmp, 0, header.Length); System.Buffer.BlockCopy(data, 0, tmp, header.Length, data.Length); return(tmp); }
public void HandleReceiveData(TcpSocket <MsgPrefix> tcpSocket, MsgPrefix msgNote, MemoryStream msgStream) { if (msgNote.MsgID == (ushort)eMsgID.C2S_AttributeStream) { Launcher.instance.connectionMgr.ProcessAttributeStream(new CTSMarker(tcpSocket, null), msgStream.ToArray()); } else { // Common message } }
public virtual void SendRawData(CTSMarker ctsMarker, MsgPrefix msgNote, byte[] protoBytes) { }