12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Net.Sockets;
- namespace SuperSocket.Common
- {
-
-
-
- public static class Platform
- {
- static Platform()
- {
- try
- {
- var socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
- socket.IOControl(IOControlCode.KeepAliveValues, null, null);
- SupportSocketIOControlByCodeEnum = true;
- }
- catch (NotSupportedException)
- {
- SupportSocketIOControlByCodeEnum = false;
- }
- catch (NotImplementedException)
- {
- SupportSocketIOControlByCodeEnum = false;
- }
- catch (Exception)
- {
- SupportSocketIOControlByCodeEnum = true;
- }
- Type t = Type.GetType("Mono.Runtime");
- IsMono = t != null;
- }
-
-
-
-
-
-
- public static bool SupportSocketIOControlByCodeEnum { get; private set; }
-
-
-
-
-
-
- public static bool IsMono { get; private set; }
- }
- }
|