public TCPSocketContext(long uniqueSocketId, TCPSocketHandler handler)
 {
     this.theUniqueSocketId = uniqueSocketId;
     this.theHandler        = handler;
     this.theHandler.SetUniqueSocketId(uniqueSocketId);
     this.createTime = TCPSocketContext.NowSeconds();
 }
Esempio n. 2
0
        public long AsyncConnect(IPAddress address, ushort port, TCPSocketHandler handler)
        {
            Logger.DEBUG("Y1");
            string ipStr = address.ToString();
            long   num   = NetLib.PandoraNet_AsyncConnect(ipStr, port);

            if (num < 0L)
            {
                Logger.ERROR("NetLib.AsyncConnect ret=" + num.ToString());
                return(-1L);
            }
            NetLib.AddCommand(new AddSocketCommand
            {
                theUniqueSocketId = num,
                theHandler        = handler
            });
            return(num);
        }
Esempio n. 3
0
 public long SpawnTCPSession(IPAddress addr, ushort port, TCPSocketHandler handler)
 {
     Logger.DEBUG(string.Empty);
     return(this.netFrame.AsyncConnect(addr, port, handler));
 }
Esempio n. 4
0
 public TCPSocketContext(long uniqueSocketId, TCPSocketHandler handler)
 {
     this.theUniqueSocketId = uniqueSocketId;
     this.theHandler        = handler;
     this.theHandler.SetUniqueSocketId(uniqueSocketId);
 }