示例#1
0
        private void Communication_Begin(SocketWrapper socket)
        {
            var stop = false;
            while (!stop)
            {
                var command = socket.ReadString();

                switch (command)
                {
                    case Connection.STOP:
                        stop = true;
                        socket.Close(false);
                        this.IsConnectionInProgress = false;
                        break;
                    case Connection.EXIT:
                        stop = true;
                        this.IsExiting = true;
                        break;
                    default:
                        this.Execute(socket, command);
                        break;
                }
            }
        }
示例#2
0
 private string Communication_SendPayload(SocketWrapper client, string request)
 {
     int sent = client.WriteString(request);
     var response = client.ReadString();
     return response;
 }