public FTPDataSocketManager(string userName, ushort port, int bufferSize = 10240)
        {
            _autoResetEvent = new AutoResetEvent(false);

            var option = SocketOptionBuilder.Instance
                         .SetSocket()
                         .UseIocp()
                         .SetPort(port)
                         .SetReadBufferSize(bufferSize)
                         .SetWriteBufferSize(bufferSize)
                         .Build();
            var dataSocket = SocketFactory.CreateServerSocket(option);

            dataSocket.OnAccepted     += DataSocket_OnAccepted;
            dataSocket.OnDisconnected += DataSocket_OnDisconnected;
            dataSocket.OnError        += _serverSocket_OnError;
            dataSocket.OnReceive      += DataSocket_OnReceive;
            _dataSocket = dataSocket;
            _userName   = userName;
            _dataSocket.Start();
        }
Beispiel #2
0
 public void Start()
 {
     _serverSokcet.Start();
 }
Beispiel #3
0
 public void Start(int backlog = 10000)
 {
     serverSokcet.Start(backlog);
 }
Beispiel #4
0
 internal void Start()
 {
     _server.Start();
 }
Beispiel #5
0
 public void Start()
 {
     _server.Start();
 }
Beispiel #6
0
 public void Start(int backlog = 10000)
 {
     _server.Start(backlog);
 }
Beispiel #7
0
 public void SendData(byte[] data)
 {
     _dataSocket.Start();
     _autoResetEvent1.WaitOne();
     _dataSocket.SendAsync(_id, data);
 }
Beispiel #8
0
 public void Start()
 {
     _serverSocket.Start();
 }
Beispiel #9
0
        public void Start(int backlog = 10 * 1000)
        {
            _serverSokcet.Start(backlog);

            _calcBegin = true;
        }