Example #1
0
    public static void Connect(string Ip, int port, ConnectCallBack callBack)
    {
        mNetmaskCtr.ShowLoading(true);
        Connection c = mConnectionManager.CreateConnection(Ip, port);

        connCallBack = callBack;
    }
 public void Connect(string hostName, int port, ConnectCallBack callBack)
 {
     if (ProcessCheckStatus.data.SQLServerLoaction == "" || ProcessCheckStatus.data.SQLServerLoaction == null)
     {
         return;
     }
     _connectCallBack = callBack;
     _BaseSocket.BeginConnect(hostName, port, connectCallback, null);
 }
Example #3
0
    //不用这个
    private static void Connect(bool isGameCenter, ConnectCallBack callBack)
    {
        mNetmaskCtr.ShowLoading(true);
        Connection c = mConnectionManager.CreateConnection(mIpAdress, mPort);

        connCallBack = callBack;
        if (isGameCenter)
        {
            GameCenter = c;
        }
    }
Example #4
0
 public bool Init(ConnectCallBack connectCb         = null, DisconnectCallBack disconnectCb = null,
                  RecvMessageCallBack recvMessageCb = null, int netCommandQueueSize         = 0, int netEventQueueSize     = 0
                  , int netSendQueueSize            = 0, int socketConnectTimeoutMSec       = 0, int socketSendTimeoutMSec = 0)
 {
     this.connectCb                = connectCb;
     this.disconnectCb             = disconnectCb;
     this.recvMessageCb            = recvMessageCb;
     this.socketConnectTimeOutMSec = socketConnectTimeoutMSec;
     this.socketSendTimeOutMSec    = socketSendTimeoutMSec;
     this.netCommandPool           = new ConcurrentObjectPool <NetCommand>();
     this.netEventPool             = new ConcurrentObjectPool <NetEvent>();
     this.netSendPool              = new ConcurrentObjectPool <SocketSendStateObject>();
     this.netCommandQueue          = new ConcurrentQueue <NetCommand>();
     this.netEventQueue            = new ConcurrentQueue <NetEvent>();
     this.netSendQueue             = new ConcurrentQueue <SocketSendStateObject>();
     this.netSendThread            = new Thread(NetSendThreadFunc);
     this.netThread                = new Thread(NetThreadFunc);
     return(true);
 }
Example #5
0
 /// <summary>
 /// Connect to the server.
 /// </summary>
 /// <param name="serverEndPoint">IP address and port of the server.</param>
 /// <param name="proxyEndPoint">Proxy IP address and port.</param>
 /// <param name="callBack">Callback upon connection.</param>
 public void Connect(IPEndPoint serverEndPoint, IPEndPoint proxyEndPoint, ConnectCallBack callBack)
 {
     lock (this.operations)
       {
     this.operations.Enqueue(new ConnectOperation(serverEndPoint, proxyEndPoint, callBack));
       }
 }
Example #6
0
 public void Connect(string ipAddr, int port, ConnectCallBack connectCallBack)
 {
     _connectCallBack  = null;
     _connectCallBack += connectCallBack;
     Connect(ipAddr, port);
 }
        public void Connect(string hostName, int port, ConnectCallBack callBack)
        {
            _connectCallBack = callBack;

            _baseSocket.BeginConnect(hostName, port, connectCallBack, null);
        }
Example #8
0
 /// <summary>
 /// Create a new connect operation.
 /// </summary>
 /// <param name="serverEndPoint">IP address and port of server.</param>
 /// <param name="proxyEndPoint">Proxy IP address and port.</param>
 /// <param name="callBack">Callback upon completion.</param>
 public ConnectOperation(IPEndPoint serverEndPoint, IPEndPoint proxyEndPoint, ConnectCallBack callBack)
 {
     this.serverEndPoint = serverEndPoint;
     this.proxyEndPoint = proxyEndPoint;
     this.callBack = callBack;
 }
 /// <summary>
 /// 登录服务器
 /// </summary>
 public static void DoConnect(Action<JObject> connectCallback)
 {
     OnConnected += new ConnectCallBack(connectCallback);
 }