public async Task Connect(string uri) { NeSTCommonClass.WriteTextFile(LogPath + Logfilename, "Client:Handshake Connectivity Process Sending from Client Level Process Starts", true); Thread.Sleep(1000); //wait for a sec, so server starts and ready to accept connection.. // ClientWebSocket webSocket = null; try { webSocket = new ClientWebSocket(); await webSocket.ConnectAsync(new Uri(uri), CancellationToken.None); NeSTCommonClass.WriteTextFile(LogPath + Logfilename, "Client:Handshake Connectivity Process Sending from Client Level Process Ends", true); await Task.WhenAll(Receive(webSocket)); } catch (Exception ex) { NeSTCommonClass.WriteTextFile(LogPath + Logfilename, "Client:HandShake Connectivity Process Failed: " + ex.Message.ToString() + "", true); } finally { if (webSocket != null) webSocket.Dispose(); //Console.WriteLine(); //Console.WriteLine("WebSocket closed."); } NeSTCommonClass.WriteTextFile(LogPath + Logfilename, "Client:Handshake Connectivity Process Sending from Client Level Process Ends", true); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)