socket2 C#과 MFC Socket 통신하기 참조 C#에서 MFC와 통신하기. 통상 편리를 위해 TcpClient를 이용한다. Stream으로 주고 받으려 했으나 이래저래 자꾸 안돼서 tcpClient.Client.Send(btBuf, (int)uLen, SocketFlags.None); 요런식으로 날림.. 2010. 6. 9. 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 다음