protected override void Init() { mSocket = -1; mHead = new NetworkHeadFormat(); mBufferHeadSize = (uint)NetworkHeadFormat.Size(); mBufferHead = Marshal.AllocHGlobal((int)mBufferHeadSize); }
public void CopyFrom(NetworkHeadFormat other) { mSendBytes.Clear(); this.mType = other.mType; this.mLength = other.mLength; this.mResult = other.mResult; this.mFrom = other.mFrom; this.mTo = other.mTo; this.mSession = other.mSession; this.mAddition = other.mAddition; this.mMask = other.mMask; mIsInitialized = true; }
private void InitMember(string ip, int port) { isStop = false; mIP = ip; // GetIP(ip); mHead = new NetworkHeadFormat(); mContents = null; mPort = port; ConnectState = NetworkConnectState.Already; NetworkHeadFormat temp = new NetworkHeadFormat(); temp.mType = NetworkCommandType.HeartCodec; mHeartBytes = temp.Merge(null); }
public NetworkHeadFormat Clone() { NetworkHeadFormat head = new NetworkHeadFormat(); head.mType = mType; head.mLength = mLength; head.mResult = mResult; head.mFrom = mFrom; head.mTo = mTo; head.mSession = mSession; head.mAddition = mAddition; head.mMask = mMask; mIsInitialized = true; mSendBytes.Clear(); return(head); }