1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556 |
- 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.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.KeepAlive, true);
- 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; }
- }
- }
|