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
}