+ m_lastError = wxPROTO_CONNERR;
+ wxLogError(_("Timeout while waiting for FTP server to connect, try passive mode."));
+ delete sock;
+ sock = NULL;
+ }
+ else
+ {
+ sock = sockSrv->Accept(true);
+ delete sockSrv;
+ }
+
+ return sock;
+}
+
+wxString wxFTP::GetPortCmdArgument(wxIPV4address addrLocal,
+ wxIPV4address addrNew)
+{
+ // Just fills in the return value with the local IP
+ // address of the current socket. Also it fill in the
+ // PORT which the client will be listening on
+
+ wxString addrIP = addrLocal.IPAddress();
+ int portNew = addrNew.Service();
+
+ // We need to break the PORT number in bytes
+ addrIP.Replace(_T("."), _T(","));
+ addrIP << _T(',')
+ << wxString::Format(_T("%d"), portNew >> 8) << _T(',')
+ << wxString::Format(_T("%d"), portNew & 0xff);