// connection public void startConnection() { TcpClient client = new TcpClient(Config.host, Config.port); this.stream = new SslStream(client.GetStream(), false, new RemoteCertificateValidationCallback(validateCertificate), null); try { this.stream.AuthenticateAsClient(Config.machineName); TCPHelper.write(this.stream, Request.newRequest()); } catch (Exception e) { Console.WriteLine("Couldn't authenticate: {0}", e.StackTrace); if (e.InnerException != null) { Console.WriteLine("Inner exception: {0}", e.InnerException.Message); } client.Close(); return; } this.thread = new Thread(new ThreadStart(readRequest)); this.thread.Start(); }
public void writeRequest(Request request) { Console.WriteLine("SERVER: " + request); TCPHelper.write(this.stream, request); }
// messaging public void writeRequest(Request request) { TCPHelper.write(this.stream, request); }
// messaging protected void writeRequest(Request request) { TCPHelper.write(this.stream, request); }