Example #1
0
        private BinaryWriter writer; // facilitates writing to the stream

        #endregion Fields

        #region Constructors

        internal NetPlayer(Socket socket, ChatServerForm serverValue, int newNumber)
        {
            connection = socket;
            server = serverValue;
            number = newNumber + ".player";

            // create NetworkStream object for Socket
            socketStream = new NetworkStream(connection);

            // create Streams for reading/writing bytes
            writer = new BinaryWriter(socketStream);
            reader = new BinaryReader(socketStream);
            getBrand += new brandHandler(server.PC.getClientBrand);
            getCheckResult += new CheckResultHandler(server.PC.CheckUserResult);
            getBrandplayer += new BrandplayerHandler(server.PC.CheckChowResult);
        }
Example #2
0
        internal NetPlayer(Socket socket, ChatServerForm serverValue, int newNumber)
        {
            connection = socket;
            server     = serverValue;
            number     = newNumber + ".player";

            // create NetworkStream object for Socket
            socketStream = new NetworkStream(connection);

            // create Streams for reading/writing bytes
            writer          = new BinaryWriter(socketStream);
            reader          = new BinaryReader(socketStream);
            getBrand       += new brandHandler(server.PC.getClientBrand);
            getCheckResult += new CheckResultHandler(server.PC.CheckUserResult);
            getBrandplayer += new BrandplayerHandler(server.PC.CheckChowResult);
        } // end constructor