예제 #1
0
        static void Main(string[] args)
        {
            gameMainLogic = new GameMainLogic();

            s_Server = new Socket(
                AddressFamily.InterNetwork,
                SocketType.Stream,
                ProtocolType.Tcp);


            IPEndPoint ipep = new IPEndPoint(
                IPAddress.Any, 3400);

            s_Server.Bind(ipep);
            s_Server.Listen(200);

            Console.WriteLine("1. 클라이언트 접속을 기다리는 중입니다.");

            while (true)
            {
                Socket clientSocket = s_Server.Accept();
                //int a = 0;
                //[실습 과제]
                //clientSocket을 List에 넣을것.
                UserObject user = new UserObject(clientSocket);
                user.SetID(++connectionCount);

                ms_ClientList.Add(new UserObject(clientSocket));
                Console.WriteLine("2. Accept();");
            }
        }
예제 #2
0
        static void Main(string[] args)
        {
            gameMainLogic = new GameMainLogic();

            s_Server = new Socket(
                AddressFamily.InterNetwork,
                SocketType.Stream,
                ProtocolType.Tcp);

            IPEndPoint ipep = new IPEndPoint(
                IPAddress.Any, 3400);

            s_Server.Bind(ipep);
            s_Server.Listen(200);

            Console.WriteLine("1. 클라이언트 접속을 기다리는 중입니다.");

            while(true)
            {
                Socket clientSocket = s_Server.Accept();
                //int a = 0;
                //[실습 과제]
                //clientSocket을 List에 넣을것.
                UserObject user = new UserObject(clientSocket);
                user.SetID(++connectionCount);

                ms_ClientList.Add(user);
                Console.WriteLine("2. Accept();");
            }
        }