コード例 #1
0
            internal virtual Socket register(Selector selector,
                                             Selector.Direction operations, bool useBlockingOnly)
            {
                if (useBlockingOnly)
                {
                    return(null);
                }

                if (connectedChannel != null)
                {
                    selector.Add(connectedChannel, operations);
                    return(connectedChannel);
                }
                else if (datagramChannel != null)
                {
                    selector.Add(datagramChannel, operations);
                    return(datagramChannel);
                }
                else
                {
                    return(null);
                }
            }
コード例 #2
0
ファイル: TcpListener.cs プロジェクト: cezary12/kokos
 internal override Socket registerForSelection(Selector selector)
 {
     selector.Add(channel, Selector.Direction.ACCEPT);
     return(channel);
 }
コード例 #3
0
ファイル: UdpListener.cs プロジェクト: morambro/TrainProject
 internal override Socket registerForSelection(Selector selector)
 {
     selector.Add(channel, Selector.Direction.READ);
     return channel;
 }
コード例 #4
0
ファイル: NetworkUtils.cs プロジェクト: morambro/TrainProject
 internal virtual Socket register(Selector selector, 
     Selector.Direction operations)
 {
     if (connectedChannel != null)
     {
         selector.Add(connectedChannel, operations);
         return connectedChannel;
     }
     else
     {
         selector.Add(datagramChannel, operations);
         return datagramChannel;
     }
 }