예제 #1
0
 protected override void Init()
 {
     mSocket         = -1;
     mHead           = new NetworkHeadFormat();
     mBufferHeadSize = (uint)NetworkHeadFormat.Size();
     mBufferHead     = Marshal.AllocHGlobal((int)mBufferHeadSize);
 }
예제 #2
0
 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;
 }
예제 #3
0
        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);
        }
예제 #4
0
        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);
        }