static void Main(string[] args)
        {
            myClient client = new myClient();

            client.SendMessage("Naber la");

            Console.WriteLine("Hello World!");
        }
示例#2
0
        private void OnReadClientConnect(IAsyncResult asyn)
        {
            try
            {
                readClientSocket = default(TcpClient);
                readClientSocket = tcpReadListener.EndAcceptTcpClient(asyn);

                if (readClientSocket != null && sendClientSocket != null)
                {
                    myClient clientReq = new myClient(this, readClientSocket, sendClientSocket, guiComp);
                    clientList.Add(clientReq);
                    clientReq.StartClient();
                    updateServerMsg("New Client Connected!");
                    readClientSocket = null;
                    sendClientSocket = null;
                }
            }
            catch (Exception se)
            {
                MessageBox.Show("Client connection error :" + se.ToString());
            }

            WaitForClientConnect();
        }
 public TestMain()
 {
     _server = new myServer();
     _client = new myClient();
 }