소켓1 C#에서의 패킷 디코딩 요령 //패킷 디코딩 public static bool DecodePacket(byte[] btBuf, out uint uCommand, out object oData, out uint uLen) { uCommand = 0; oData = 0; uLen = 0; ASCIIEncoding encoding = new ASCIIEncoding(); int nOffset = 0; Object oResult; //StartCode AssignByteAsLength(out oResult, ref nOffset, btBuf, sizeof(uint)); if ((uint)oResult != STARTCODE) return false; //Session No AssignByteAsLength(out oResult, ref n.. 2010. 6. 9. 이전 1 다음