Example #1
0
        // 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();
        }
Example #2
0
 public void writeRequest(Request request)
 {
     Console.WriteLine("SERVER: " + request);
     TCPHelper.write(this.stream, request);
 }
Example #3
0
 // messaging
 public void writeRequest(Request request)
 {
     TCPHelper.write(this.stream, request);
 }
Example #4
0
 // messaging
 protected void writeRequest(Request request)
 {
     TCPHelper.write(this.stream, request);
 }