System.Net.FtpControlStream.CreateFtpListenerSocket C# (CSharp) Method

CreateFtpListenerSocket() private method

Creates the Listener socket

private CreateFtpListenerSocket ( FtpWebRequest request ) : void
request FtpWebRequest
return void
        private void CreateFtpListenerSocket(FtpWebRequest request)
        {
            // Gets an IPEndPoint for the local host for the data socket to bind to.
            IPEndPoint epListener = new IPEndPoint(((IPEndPoint)Socket.LocalEndPoint).Address, 0);
            try
            {
                _dataSocket = CreateFtpDataSocket(request, Socket);
            }
            catch (ObjectDisposedException)
            {
                throw ExceptionHelper.RequestAbortedException;
            }

            // Binds the data socket to the local end point.
            _dataSocket.Bind(epListener);
            _dataSocket.Listen(1); // Put the dataSocket in Listen mode
        }