我的 Xsocket 客户端:
Connect(Object module)
{
var socket = new XSocketClient("wss://localhost:46000/SocketController", "https://somesites.com", CertUtils.RetrieveX509Certificate2());
socket.Open();
var list = new List<Task>();
list.Add(Task.Factory.StartNew(() => socket.Send(new { Module = module, Action = "GetStatus" }, "Exec")));
list.Add(Task.Factory.StartNew(() => socket.Send(new { Module = module, Action = "GetStatus" }, "Exec")));
list.Add(Task.Factory.StartNew(() => socket.Send(dataupdate, "Update")));
Task.WaitAll(list.ToArray());
}
呼叫 1:连接(....)/成功/
Call 2: Connect(....) / System execption: You can't send messages when not connected to the server /
Call 3: Connect(....) / System execption: You can't send messages when not connected to the server /