// 初期化 void init(int port, AcceptProc acceptProc, object acceptParam, bool localOnly, bool getHostName) { 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(); }
// TCP 受付完了 void tcpAccepted(Sock s) { ThreadObj t = new ThreadObj(new ThreadProc(tcpAcceptedThread), s); t.WaitForInit(); }