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); } } } }
public string GetWebsocketPackageAsString() { NetworkStream stream=mRemote.GetStream(); WebSocketReader reader=new WebSocketReader(stream); return reader.ReadWebsocketHandshake(); }