コード例 #1
0
 public SocketServerBase(IAppServer appServer, ListenerInfo[] listeners)
 {
     AppServer = appServer;
     IsRunning = false;
     ListenerInfos = listeners;
     Listeners = new List<ISocketListener>(listeners.Length);
 }
コード例 #2
0
        public TcpSocketServerBase(IAppServer appServer, ListenerInfo[] listeners)
            : base(appServer, listeners)
        {
            var config = appServer.Config;

            uint dummy = 0;
            m_KeepAliveOptionValues = new byte[Marshal.SizeOf(dummy) * 3];
            //whether enable KeepAlive
            BitConverter.GetBytes((uint)1).CopyTo(m_KeepAliveOptionValues, 0);
            //how long will start first keep alive
            BitConverter.GetBytes((uint)(config.KeepAliveTime * 1000)).CopyTo(m_KeepAliveOptionValues, Marshal.SizeOf(dummy));
            //keep alive interval
            BitConverter.GetBytes((uint)(config.KeepAliveInterval * 1000)).CopyTo(m_KeepAliveOptionValues, Marshal.SizeOf(dummy) * 2);

            m_SendTimeOut = config.SendTimeOut;
            m_ReceiveBufferSize = config.ReceiveBufferSize;
            m_SendBufferSize = config.SendBufferSize;
        }
コード例 #3
0
 protected abstract ISocketListener CreateListener(ListenerInfo listenerInfo);
コード例 #4
0
 protected override ISocketListener CreateListener(ListenerInfo listenerInfo)
 {
     return new TcpAsyncSocketListener(listenerInfo);
 }
コード例 #5
0
 public TcpAsyncSocketListener(ListenerInfo info)
     : base(info)
 {
     m_ListenBackLog = info.BackLog;
 }
コード例 #6
0
ファイル: TcpSocketServerBase.cs プロジェクト: xxjeng/nuxleus
 protected virtual ISocketListener CreateListener(ListenerInfo listenerInfo)
 {
     return new TcpAsyncSocketListener(listenerInfo);
 }
コード例 #7
0
 public AsyncSocketServer(IAppServer appServer, ListenerInfo[] listeners)
     : base(appServer, listeners)
 {
 }
コード例 #8
0
 public UdpSocketListener(ListenerInfo info, IPool<SaeState> saePool)
     : base(info)
 {
     m_SaePool = saePool;
 }
コード例 #9
0
 public UdpSocketListener(ListenerInfo info)
     : base(info)
 {
 }
コード例 #10
0
 protected SocketListenerBase(ListenerInfo info)
 {
     Info = info;
 }
コード例 #11
0
 public UdpSocketListener(ListenerInfo info, IPool<SocketAsyncEventArgs> saePool)
     : base(info)
 {
     m_SaePool = saePool;
 }
コード例 #12
0
 public TcpAsyncSocketListener(ListenerInfo info)
 {
     Info = info;
     m_ListenBackLog = info.BackLog;
 }