Move SetDefaultTimeout to wxProtocol and set it to 60 seconds for both wxHTTP and wxFTP

Move SetPassword and SetUser implementations to wxProtocol to avoid code redundancy
Make const-correct various getters
Reorganize wxFTP docs
Move wxStringToStringHashMap to hashmap.h and document its existance



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@58137 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Francesco Montorsi
2009-01-16 15:08:13 +00:00
parent dc813e6c7e
commit 730b772b41
13 changed files with 356 additions and 230 deletions

View File

@@ -28,15 +28,9 @@
#include <stdlib.h>
/////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// wxProtoInfo
/////////////////////////////////////////////////////////////////
/*
* --------------------------------------------------------------
* --------- wxProtoInfo CONSTRUCTOR ----------------------------
* --------------------------------------------------------------
*/
// ----------------------------------------------------------------------------
wxProtoInfo::wxProtoInfo(const wxChar *name, const wxChar *serv,
const bool need_host1, wxClassInfo *info)
@@ -53,9 +47,10 @@ wxProtoInfo::wxProtoInfo(const wxChar *name, const wxChar *serv,
#endif
}
/////////////////////////////////////////////////////////////////
// wxProtocol ///////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////
// ----------------------------------------------------------------------------
// wxProtocol
// ----------------------------------------------------------------------------
#if wxUSE_SOCKETS
IMPLEMENT_ABSTRACT_CLASS(wxProtocol, wxSocketClient)
@@ -68,6 +63,8 @@ wxProtocol::wxProtocol()
: wxSocketClient()
#endif
{
m_lastError = wxPROTO_NOERR;
SetDefaultTimeout(60); // default timeout is 60 seconds
}
#if wxUSE_SOCKETS
@@ -90,6 +87,15 @@ bool wxProtocol::Reconnect()
return true;
}
void wxProtocol::SetDefaultTimeout(wxUint32 Value)
{
m_uiDefaultTimeout = Value;
#if wxUSE_SOCKETS
wxSocketBase::SetTimeout(Value); // sets it for this socket
#endif
}
// ----------------------------------------------------------------------------
// Read a line from socket
// ----------------------------------------------------------------------------