示例#1
0
        public Listener(int port, AcceptProc acceptProc, object acceptParam, bool localOnly = false, bool getHostName = false)
        {
            this.lockObj         = new object();
            this.Port            = port;
            this.AcceptProc      = acceptProc;
            this.AcceptParam     = acceptParam;
            this.Status          = ListenerStatus.Trying;
            this.eventObj        = new Event();
            this.halt            = false;
            this.LocalOnly       = localOnly;
            this.GetHostName     = getHostName;
            this.ListenRetryTime = ListenRetryTimeDefault;

            // スレッドの作成
            ThreadObj thread = new ThreadObj(new ThreadProc(ListenerThread));

            thread.WaitForInit();
        }
示例#2
0
        // TCP 受付完了
        void tcpAccepted(Sock s)
        {
            ThreadObj t = new ThreadObj(new ThreadProc(tcpAcceptedThread), s);

            t.WaitForInit();
        }