示例#1
0
        public PipeListener(Loop loop, bool ipc) : base(loop, ipc)
        {
            _onReadAction = (p, s) => OnRead(p, s);

            _pipes      = new List <Pipe>();
            _windowsApi = new WindowsApi();
            _requestId  = 0;
        }
示例#2
0
        internal static bool GetReuseAddress(TcpHandle tcpHandle)
        {
            IntPtr socketHandle = GetSocketHandle(tcpHandle);

            return(IsWindows
                ? WindowsApi.GetReuseAddress(socketHandle)
                : UnixApi.GetReuseAddress(socketHandle));
        }
        internal static bool GetReuseAddress(TcpHandle tcpHandle)
        {
            IntPtr socketHandle = GetSocketHandle(tcpHandle);

            return(RuntimeInformation.IsOSPlatform(OSPlatform.Windows)
                ? WindowsApi.GetReuseAddress(socketHandle)
                : UnixApi.GetReuseAddress(socketHandle));
        }
示例#4
0
        internal static void SetReuseAddress(TcpHandle tcpHandle, int value)
        {
            IntPtr socketHandle = GetSocketHandle(tcpHandle);

            if (IsWindows)
            {
                WindowsApi.SetReuseAddress(socketHandle, value);
            }
            else
            {
                UnixApi.SetReuseAddress(socketHandle, value);
            }
        }
        internal static void SetReuseAddress(TcpHandle tcpHandle, int value)
        {
            IntPtr socketHandle = GetSocketHandle(tcpHandle);

            if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
            {
                WindowsApi.SetReuseAddress(socketHandle, value);
            }
            else
            {
                UnixApi.SetReuseAddress(socketHandle, value);
            }
        }
示例#6
0
 public PipeListener(Loop loop, bool ipc) : base(loop, ipc)
 {
     this.pipes      = new List <Pipe>();
     this.windowsApi = new WindowsApi();
     this.requestId  = 0;
 }