コード例 #1
0
ファイル: NtpdServerCommands.cs プロジェクト: makelife/netpad
        public NtpdServerCommands(NtpdServer parent, NtpdPersistentData dataIn)
        {
            main = parent;
            dataIn = dataIn;

            Thread commandsThread = new Thread(CommandListener);
            commandsThread.Start();
        }
コード例 #2
0
ファイル: NtpdServer.cs プロジェクト: makelife/netpad
        public NtpdServer()
        {
            dataStorage = new NtpdPersistentData();
            cmdInterface = new NtpdServerCommands(this, dataStorage);
            sconv = new StreamConverter();
            tcpServer = new TcpListener(IPAddress.Any, 8888);
            Thread listenThread = new Thread(new ThreadStart(NewClient));
            listenThread.Start();

            // Currently this creates five fake clients to connect to the fledgeling server.

            for(int i = 0; i<5; i++)
            {
                TcpClient tcpC = new TcpClient();

                tcpC.Connect("localhost", 8888);

                Thread clientThread = new Thread(new ParameterizedThreadStart(ClientMain));
                clientThread.Start(tcpC);
            }
        }