Beispiel #1
0
 public Client(Socket clientSocket, Server server)
 {
     mysqlConn = ConnHelper.Connect();
     Console.WriteLine("一个客户端连接");
     this.clientSocket = clientSocket;
     this.server       = server;
 }
Beispiel #2
0
 public Client(Socket clientSocket, Server server)
 {
     this.clientSocket = clientSocket;
     this.server       = server;
     sqlConn           = ConnHelper.Connect();
     message           = new Message();
 }
Beispiel #3
0
 public Client(Socket clientSocket, Server server)
 {
     this.clientSocket = clientSocket;
     this.server       = server;
     mysqlConn         = ConnHelper.Connect();
     Start();
 }
Beispiel #4
0
 public Client(Socket clientSocket, Server server)
 {
     //建立数据库连接
     mysqlConnect      = ConnHelper.Connect();
     this.clientSocket = clientSocket;
     this.server       = server;
 }
Beispiel #5
0
 public Client(Socket clientSocket, Server server)
 {
     Console.WriteLine("[Client]初始化");
     this.clientSocket = clientSocket;
     this.server       = server;
     mysqlConn         = ConnHelper.Connect();
     Start();
 }
Beispiel #6
0
 public Client(Socket clientSocket)
 {
     RemoteEndPoint      = clientSocket.RemoteEndPoint;
     messageAsyncReceive = new MessageAsyncReceive(msg);
     messageAsyncReceive.BeginReceive(ReceiveCallback);
     session   = new TcpSession(clientSocket, messageAsyncReceive);
     mySqlConn = ConnHelper.Connect();
 }
Beispiel #7
0
 public Client(Socket _clientSocket, GameServer server)
 {
     clientSocket = _clientSocket;
     this.server  = server;
     msg          = new Message();
     connHelper   = new ConnHelper();
     connHelper.Connect();
     BeginReceive();
 }
Beispiel #8
0
 public Client(Socket clientSocket, Server server)
 {
     this.clientSocket = clientSocket;
     this.server       = server;
     this.ip           = ((IPEndPoint)clientSocket.RemoteEndPoint).Address.ToString();
     this.port         = ((IPEndPoint)clientSocket.RemoteEndPoint).Port;
     this.msg          = new Message();
     mySqlCon          = ConnHelper.Connect();
 }
Beispiel #9
0
 public Client(Socket serverSocket, EndPoint remoteEP)
 {
     RemoteEndPoint      = remoteEP;
     messageAsyncReceive = new MessageAsyncReceive(msg);
     messageAsyncReceive.BeginReceive(ReceiveCallback);
     session   = new KcpSession(serverSocket, messageAsyncReceive, remoteEP);
     mySqlConn = ConnHelper.Connect();
     ConsoleUtility.WriteLine("Connect: " + RemoteEndPoint.ToString(), ConsoleColor.Green);
 }
Beispiel #10
0
        public ClientPeer()
        {
            this.ReceiveArgs           = new SocketAsyncEventArgs();
            this.ReceiveArgs.UserToken = this;
            this.ReceiveArgs.SetBuffer(new byte[1024], 0, 1024);
            this.SendArgs            = new SocketAsyncEventArgs();
            this.SendArgs.Completed += SendArgs_Completed;

            mySqlConn = ConnHelper.Connect();
        }
Beispiel #11
0
 public ClientPeer(Socket _socket, MainServer _server)
 {
     mMsg         = new MessageTool();
     mClientSock  = _socket;
     this.mServer = _server;
     mMysqlConn   = ConnHelper.Connect();
     ImgPathDic   = new Dictionary <int, string>()
     {
         { 1001, "iiefrqwrief" },
         { 1002, "iiefrqwrief" },
         { 1003, "iiefrqwrief" },
         { 1004, "iiefrqwrief" },
     };
 }
 public void Start()
 {
     try
     {
         sqlConn      = ConnHelper.Connect();
         serverSocket = new Socket(AddressFamily.InterNetwork
                                   , SocketType.Stream, ProtocolType.Tcp);
         serverSocket.Bind(ipEndPoint);
         serverSocket.Listen(0);
         serverSocket.BeginAccept(AcceptCallBack, null);
     }
     catch (Exception e)
     {
         Console.WriteLine("服务器启动失败:" + e);
     }
 }
 public Client(Socket clientSocket, Server server)
 {
     this.clientSocket = clientSocket;
     this.server       = server;
     mySqlConn         = ConnHelper.Connect();//建立Client到数据库的连接
 }
Beispiel #14
0
 public Client(Socket socket, Server server)
 {
     this.clientSocket = socket;
     this.server       = server;
     mMysqlConnection  = ConnHelper.Connect();
 }
Beispiel #15
0
 /// <summary>
 /// 带参构造方法
 /// </summary>
 /// <param name="clientSocket">已连接的客户端连接对象</param>
 /// <param name="server">服务器对象</param>
 public Client(Socket clientSocket, Server server)
 {
     this.clientSocket = clientSocket;
     this.server       = server;
     this.mysqlConn    = ConnHelper.Connect();//开启一个数据库连接,一个客户端连接对应一个数据库连接
 }