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