Ignore:
Timestamp:
Feb 23, 2002, 5:39:10 PM (24 years ago)
Author:
sandervl
Message:

Don't send FD_CONNECT for sockets that are returned by accept

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wsock32/asyncthread.cpp

    r7977 r7992  
    1 /* $Id: asyncthread.cpp,v 1.14 2002-02-20 15:07:13 sandervl Exp $ */
     1/* $Id: asyncthread.cpp,v 1.15 2002-02-23 16:39:09 sandervl Exp $ */
    22
    33/*
     
    239239{
    240240 PASYNCTHREADPARM pThreadInfo;
    241  
     241
    242242   asyncThreadMutex.enter();
    243243   pThreadInfo = FindAsyncEvent(s);
    244    if(pThreadInfo) {
     244   if(pThreadInfo)
     245   {
     246        int size, state, tmp;
     247        state = ioctl(s, FIOBSTATUS, (char *)&tmp, sizeof(tmp));
     248        dprintf(("FindAndSetAsyncEvent: state %x", state));
     249
     250        //Don't send FD_CONNECT is socket was already connected (accept returns connected socket)
     251        if(state & SS_ISCONNECTED) {
     252             pThreadInfo->fConnected = TRUE;
     253        }
     254        else pThreadInfo->fConnected = FALSE;
     255
    245256        pThreadInfo->u.asyncselect.mode           = mode;
    246257        pThreadInfo->u.asyncselect.lEvents        = lEventMask;
Note: See TracChangeset for help on using the changeset viewer.