Пример #1
0
        public static void Close(Socket socket)
        {
            if (socket == null)
            {
                return;
            }

            ExUtil.IgnoreException(() =>
            {
                socket.Close(10000);
            });
        }
Пример #2
0
        public static void ShutDown(Socket socket)
        {
            if (socket == null)
            {
                return;
            }

            ExUtil.IgnoreException(() =>
            {
                socket.Shutdown(SocketShutdown.Both);
                socket.Close(10000);
            });
        }