EditorClient.Client.SendAndWait C# (CSharp) Method

SendAndWait() public method

public SendAndWait ( string message ) : void
message string
return void
        public void SendAndWait(string message)
        {
            Send(message);
            IsSending = true;
            var timeout = DateTime.Now;
            while (IsSending && DateTime.Now.Subtract(timeout).TotalMilliseconds < 8000)
                Thread.Sleep(10);
        }

Usage Example

示例#1
0
 public void Send(string message)
 {
     var client = new Client();
     client.Connect(Port, (s) => {});
     if (!client.IsConnected)
         return;
     client.SendAndWait(message);
     client.Disconnect();
 }