コード例 #1
0
 public InfoSocket(Socket socket, RelayInfoServer server)
     : base(socket, server)
 {
     this.t = new Thread(this.receive);
     t.Start();
     this.isReady = true;
 }
コード例 #2
0
 public InfoSocket(Socket socket, RelayInfoServer server)
     : base(socket, server)
 {
     this.t = new Thread(this.receive);
     t.Start();
     this.isReady = true;
 }
コード例 #3
0
ファイル: Host.cs プロジェクト: ofenstichloch/HexaverseRelay
        public void startHost(int cp, string host, int sp)
        {
            this.clientHost = host;
            this.clientPort = cp;
            this.serverPort = sp;

            hostID        = Protocol.TUniqueID.generate();
            worldID       = Protocol.TUniqueID.generate();
            buffer        = new MessageBuffer(this);
            sessionClient = new RelaySessionClient("SessionClient1", host, clientPort + 1, this, buffer);
            infoClient    = new RelayInfoClient("InfoClient1", clientHost, clientPort, this);
            sessionServer = new RelaySessionServer("SessionServer1", serverPort + 1, this, buffer);
            infoServer    = new RelayInfoServer("InfoServer1", serverPort, this);
            Statistics stats = new Statistics(buffer, sessionClient, sessionServer);

            sessionClient.setServer(sessionServer);
            infoClient.setServer(infoServer);
            if (infoClient.connect() && sessionClient.connect())
            {
                Log.notify("Clients connected", this);
                if (infoServer.connect() && sessionServer.connect())
                {
                    Log.notify("Server started on port " + serverPort, this);
                    Console.ReadLine();

                    disconnect();
                }
                else
                {
                    Log.error("Failed to start server", this);
                }
            }
            else
            {
                Log.error("Failed to connect gameclient", this);
            }
        }
コード例 #4
0
ファイル: Host.cs プロジェクト: ofenstichloch/HexaverseRelay
        public void startHost(int cp, string host, int sp)
        {
            this.clientHost = host;
            this.clientPort = cp;
            this.serverPort = sp;

            hostID = Protocol.TUniqueID.generate();
            worldID = Protocol.TUniqueID.generate();
            buffer = new MessageBuffer(this);
            sessionClient = new RelaySessionClient("SessionClient1", host, clientPort + 1, this, buffer);
            infoClient = new RelayInfoClient("InfoClient1", clientHost, clientPort, this);
            sessionServer = new RelaySessionServer("SessionServer1", serverPort + 1,this, buffer);
            infoServer = new RelayInfoServer("InfoServer1", serverPort, this);
            Statistics stats = new Statistics(buffer, sessionClient, sessionServer);
            sessionClient.setServer(sessionServer);
            infoClient.setServer(infoServer);
            if (infoClient.connect() && sessionClient.connect())
            {
                Log.notify("Clients connected", this);
                if(infoServer.connect() && sessionServer.connect())
                {
                    Log.notify("Server started on port "+serverPort, this);
                    Console.ReadLine();

                    disconnect();
                }
                else
                {
                    Log.error("Failed to start server", this);
                }
            }
            else
            {
                Log.error("Failed to connect gameclient", this);
            }
        }