Exemple #1
0
        //#####################################################################################

        public void Connect(string address, string port)
        {
            // 이전연결 해제
            Disconnect();


            // 연결
            m_client = new TcpClient();

            try
            {
                m_client.Connect(address, int.Parse(port));
            }
            catch (SocketException)
            {
                m_client = null;
                return;
            }


            m_runCheckConnection    = true;
            m_checkConnectionThread = new Thread(this.CheckConnectionJob);
            m_checkConnectionThread.Start();


            // 메세지 수신/송신 준비
            m_receiver.Start(m_client.Client);
            m_sender.Start(m_client.Client);
        }
Exemple #2
0
        public ServerVisitor(Socket sock)
        {
            m_sender   = new IO.NetSender();
            m_receiver = new IO.NetReceiver(m_sender);


            m_socket = sock;

            m_receiver.Start(sock);
            m_sender.Start(sock);
        }