コード例 #1
0
        public TcpSocketSaeaClient(IPEndPoint remoteEP, IPEndPoint localEP, ITcpSocketSaeaClientMessageDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
        {
            if (remoteEP == null)
            {
                throw new ArgumentNullException("remoteEP");
            }
            if (dispatcher == null)
            {
                throw new ArgumentNullException("dispatcher");
            }

            _remoteEndPoint = remoteEP;
            _localEndPoint  = localEP;
            _dispatcher     = dispatcher;
            _configuration  = configuration ?? new TcpSocketSaeaClientConfiguration();

            if (_configuration.BufferManager == null)
            {
                throw new InvalidProgramException("The buffer manager in configuration cannot be null.");
            }
            if (_configuration.FrameBuilder == null)
            {
                throw new InvalidProgramException("The frame handler in configuration cannot be null.");
            }

            Initialize();
        }
コード例 #2
0
 public TcpSocketSaeaClient(IPAddress remoteAddress, int remotePort, IPEndPoint localEP,
                            Func <TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
                            Func <TcpSocketSaeaClient, Task> onServerConnected    = null,
                            Func <TcpSocketSaeaClient, Task> onServerDisconnected = null,
                            TcpSocketSaeaClientConfiguration configuration        = null)
     : this(new IPEndPoint(remoteAddress, remotePort), localEP,
            onServerDataReceived, onServerConnected, onServerDisconnected, configuration)
 {
 }
コード例 #3
0
 public TcpSocketSaeaClient(IPAddress remoteAddress, int remotePort, IPAddress localAddress, int localPort,
     Func<TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
     Func<TcpSocketSaeaClient, Task> onServerConnected = null,
     Func<TcpSocketSaeaClient, Task> onServerDisconnected = null,
     TcpSocketSaeaClientConfiguration configuration = null)
     : this(new IPEndPoint(remoteAddress, remotePort), new IPEndPoint(localAddress, localPort),
           onServerDataReceived, onServerConnected, onServerDisconnected, configuration)
 {
 }
コード例 #4
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP,
                            Func <TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
                            Func <TcpSocketSaeaClient, Task> onServerConnected    = null,
                            Func <TcpSocketSaeaClient, Task> onServerDisconnected = null,
                            TcpSocketSaeaClientConfiguration configuration        = null)
     : this(remoteEP, null,
            onServerDataReceived, onServerConnected, onServerDisconnected, configuration)
 {
 }
コード例 #5
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP, IPEndPoint localEP,
                            Func <TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
                            Func <TcpSocketSaeaClient, Task> onServerConnected    = null,
                            Func <TcpSocketSaeaClient, Task> onServerDisconnected = null,
                            TcpSocketSaeaClientConfiguration configuration        = null)
     : this(remoteEP, localEP,
            new InternalTcpSocketSaeaClientMessageDispatcherImplementation(onServerDataReceived, onServerConnected, onServerDisconnected),
            configuration)
 {
 }
コード例 #6
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP, IPEndPoint localEP,
                            Func <TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
                            Func <TcpSocketSaeaClient, Task> onServerConnected    = null,
                            Func <TcpSocketSaeaClient, Task> onServerDisconnected = null,
                            TcpSocketSaeaClientConfiguration configuration        = null)
     : this(remoteEP, localEP,
            new DefaultTcpSocketSaeaClientEventDispatcher(onServerDataReceived, onServerConnected, onServerDisconnected),
            configuration)
 {
 }
コード例 #7
0
        public TcpSocketSaeaClient(IPEndPoint remoteEP, IPEndPoint localEP, ITcpSocketSaeaClientMessageDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
        {
            if (remoteEP == null)
                throw new ArgumentNullException("remoteEP");
            if (dispatcher == null)
                throw new ArgumentNullException("dispatcher");

            _remoteEndPoint = remoteEP;
            _localEndPoint = localEP;
            _dispatcher = dispatcher;
            _configuration = configuration ?? new TcpSocketSaeaClientConfiguration();

            if (_configuration.FrameBuilder == null)
                throw new InvalidProgramException("The frame handler in configuration cannot be null.");

            Initialize();
        }
コード例 #8
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP, ITcpSocketSaeaClientMessageDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
     : this(remoteEP, null, dispatcher, configuration)
 {
 }
コード例 #9
0
 public TcpSocketSaeaClient(IPAddress remoteAddress, int remotePort, ITcpSocketSaeaClientMessageDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
     : this(new IPEndPoint(remoteAddress, remotePort), dispatcher, configuration)
 {
 }
コード例 #10
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP, ITcpSocketSaeaClientMessageDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
     : this(remoteEP, null, dispatcher, configuration)
 {
 }
コード例 #11
0
 public TcpSocketSaeaClient(IPAddress remoteAddress, int remotePort, ITcpSocketSaeaClientMessageDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
     : this(new IPEndPoint(remoteAddress, remotePort), dispatcher, configuration)
 {
 }
コード例 #12
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP, IPEndPoint localEP,
     Func<TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
     Func<TcpSocketSaeaClient, Task> onServerConnected = null,
     Func<TcpSocketSaeaClient, Task> onServerDisconnected = null,
     TcpSocketSaeaClientConfiguration configuration = null)
     : this(remoteEP, localEP,
          new InternalTcpSocketSaeaClientMessageDispatcherImplementation(onServerDataReceived, onServerConnected, onServerDisconnected),
          configuration)
 {
 }
コード例 #13
0
 public TcpSocketSaeaClient(IPEndPoint remoteEP,
     Func<TcpSocketSaeaClient, byte[], int, int, Task> onServerDataReceived = null,
     Func<TcpSocketSaeaClient, Task> onServerConnected = null,
     Func<TcpSocketSaeaClient, Task> onServerDisconnected = null,
     TcpSocketSaeaClientConfiguration configuration = null)
     : this(remoteEP, null,
           onServerDataReceived, onServerConnected, onServerDisconnected, configuration)
 {
 }
コード例 #14
0
 public TcpSocketSaeaClient(IPAddress remoteAddress, int remotePort, IPAddress localAddress, int localPort, ITcpSocketSaeaClientEventDispatcher dispatcher, TcpSocketSaeaClientConfiguration configuration = null)
     : this(new IPEndPoint(remoteAddress, remotePort), new IPEndPoint(localAddress, localPort), dispatcher, configuration)
 {
 }