]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/socket.cpp
really show the window after creation (calling Show(TRUE) doesn't do it any more)
[wxWidgets.git] / src / common / socket.cpp
index f6d8b24360013c1889208513e2e4712bbbfcac7b..6e40e90f9132f80f44ecf2834cbfcd8267f813e9 100644 (file)
@@ -303,7 +303,6 @@ wxSocketBase& wxSocketBase::Read(void* buffer, wxUint32 nbytes)
 wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
 {
   int total;
-  int ret = 1;
 
   // Try the pushback buffer first
   total = GetPushback(buffer, nbytes, FALSE);
@@ -325,6 +324,7 @@ wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
   // wxSOCKET_BLOCK
   // wxSOCKET_NONE
   //
+  int ret;
   if (m_flags & wxSOCKET_NOWAIT)
   {
     GSocket_SetNonBlocking(m_socket, 1);
@@ -504,7 +504,6 @@ wxSocketBase& wxSocketBase::Write(const void *buffer, wxUint32 nbytes)
 wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
 {
   wxUint32 total = 0;
-  int ret = 1;
 
   // If the socket is invalid or parameters are ill, return immediately
   if (!m_socket || !buffer || !nbytes)
@@ -516,6 +515,7 @@ wxUint32 wxSocketBase::_Write(const void *buffer, wxUint32 nbytes)
   // wxSOCKET_BLOCK
   // wxSOCKET_NONE
   //
+  int ret;
   if (m_flags & wxSOCKET_NOWAIT)
   {
     GSocket_SetNonBlocking(m_socket, 1);
@@ -678,6 +678,10 @@ bool wxSocketBase::_Wait(long seconds,
   else
     timeout = m_timeout * 1000;
 
+#if !defined(wxUSE_GUI) || !wxUSE_GUI
+  GSocket_SetTimeout(m_socket, timeout);
+#endif 
+
   // Wait in an active polling loop.
   //
   // NOTE: We duplicate some of the code in OnRequest, but this doesn't
@@ -930,6 +934,7 @@ void wxSocketBase::OnRequest(wxSocketNotify notification)
   // Schedule the event
 
   wxSocketEventFlags flag = 0;
+  wxUnusedVar(flag);
   switch (notification)
   {
     case GSOCK_INPUT:      flag = GSOCK_INPUT_FLAG; break;