wxUint32 wxSocketBase::_Read(void* buffer, wxUint32 nbytes)
{
int total;
- int ret = 1;
// Try the pushback buffer first
total = GetPushback(buffer, nbytes, FALSE);
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
+ int ret;
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
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)
// wxSOCKET_BLOCK
// wxSOCKET_NONE
//
+ int ret;
if (m_flags & wxSOCKET_NOWAIT)
{
GSocket_SetNonBlocking(m_socket, 1);
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
// Schedule the event
wxSocketEventFlags flag = 0;
+ wxUnusedVar(flag);
switch (notification)
{
case GSOCK_INPUT: flag = GSOCK_INPUT_FLAG; break;