Example #1
0
        public void process()
        {
            //NetComputer comp=new NetComputer(mRemote);

            NetworkStream stream=mRemote.GetStream();
            WebSocketReader reader=new WebSocketReader(stream);

            bool websocketClosed=false;

            while(websocketClosed==false)
            {
                if(reader.IsDataAvailabe)
                {
                    MessageIn msg=reader.ReadMessage(out websocketClosed);

                    if(!websocketClosed)
                    {
                        Program.gBandwidth.increaseInterServerOutput((int)msg.getLength());
                        Logger.Write(LogLevel.Debug, "Received message {0} from {1}", msg, mRemote.Client.RemoteEndPoint);
                        processMessage(msg);
                    }
                }
            }
        }
Example #2
0
 public string GetWebsocketPackageAsString()
 {
     NetworkStream stream=mRemote.GetStream();
     WebSocketReader reader=new WebSocketReader(stream);
     return reader.ReadWebsocketHandshake();
 }