X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/6a4cbac17af82fdf6b8220b309da74b735d616fb..12b5f4b4d2d8a07962da7ba3b78c8c1ec2634a67:/src/common/protocol.cpp diff --git a/src/common/protocol.cpp b/src/common/protocol.cpp index 75981c5bb3..4a06cf857b 100644 --- a/src/common/protocol.cpp +++ b/src/common/protocol.cpp @@ -28,15 +28,9 @@ #include -///////////////////////////////////////////////////////////////// +// ---------------------------------------------------------------------------- // 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 // ----------------------------------------------------------------------------