Beispiel #1
0
 bool GetReusePort()
 {
     try
     {
         var channel     = (TcpServerChannel)this.Channel;
         var tcpListener = (TcpListener)channel.GetHandle();
         return(PlatformApi.GetReusePort(tcpListener));
     }
     catch (ObjectDisposedException ex)
     {
         throw new ChannelException(ex);
     }
     catch (SocketException ex)
     {
         throw new ChannelException(ex);
     }
 }
Beispiel #2
0
 bool GetReusePort()
 {
     try
     {
         var channel     = (INativeChannel)this.Channel;
         var tcpListener = (TcpListener)channel.GetHandle();
         return(PlatformApi.GetReusePort(tcpListener));
     }
     catch (ObjectDisposedException ex)
     {
         ThrowHelper.ThrowChannelException(ex);
     }
     catch (SocketException ex)
     {
         ThrowHelper.ThrowChannelException(ex);
     }
     return(false);
 }