title: FluentFTP.FtpClient throwing SocketException on Connect()
body: <p>I have a console program that runs perpetually to process background jobs. Every day, it uploads files via FTP to other servers. After a while it will begin to fail to transfer files with: </p>
  
  <blockquote>
    <p>SocketException: System.Net.Sockets.SocketException: An operation on a socket could not be performed because the system lacked sufficient buffer space or because a queue was full</p>
  </blockquote>
  
  <p>Rebooting the server solves the issue but it's annoying. Other answers (like <a href="https://stackoverflow.com/questions/557879/why-am-i-getting-this-socketexception-in-my-c-sharp-service">this one</a>) suggest maybe my sockets are not being closed after use but I would expect <code>FtpClient.Dispose()</code> to take care of this, since it does not expose a <code>.Close()</code> method. Here's my code:</p>
  
  <pre><code>using (FtpClient client = new FtpClient())
  {
       client.Host = "ftp.host.com";
       client.Credentials = new System.Net.NetworkCredential(userName: "foo", password: "bar");
       client.Connect();
       client.UploadFile(localPath: localPath, remotePath: remotePath, overwrite: true);
       client.Disconnect();
  }
  </code></pre>
  
  <p>Are there other possible causes for this error that I should investigate?</p>