• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/ap/gpl/amule/wxWidgets-2.8.12/src/mac/classic/

Lines Matching refs:sck

482 GSocketError GSocket_SetServer(GSocket *sck)
484 assert(sck != NULL);
487 if (sck->m_endpoint != kOTInvalidEndpointRef )
489 sck->m_error = GSOCK_INVSOCK;
494 if (!sck->m_local)
496 sck->m_error = GSOCK_INVADDR;
501 sck->m_stream = TRUE;
502 sck->m_server = TRUE;
503 sck->m_oriented = TRUE;
508 sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_STREAM, 0);
509 socket_set_ref( sck->m_endpoint , (unsigned long) &gMacNetEvents , (unsigned long) sck ) ;
510 if (sck->m_endpoint == kOTInvalidEndpointRef)
512 sck->m_error = GSOCK_IOERR;
516 ioctl(sck->m_endpoint, FIONBIO, &arg);
517 _GSocket_Enable_Events(sck);
523 if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) ||
524 (getsockname(sck->m_endpoint,
525 sck->m_local->m_addr,
526 (WX_SOCKLEN_T *) &sck->m_local->m_len) != 0) ||
527 (listen(sck->m_endpoint, 5) != 0))
529 close(sck->m_endpoint);
530 sck->m_endpoint = -1;
531 sck->m_error = GSOCK_IOERR;
643 GSocketError GSocket_SetNonOriented(GSocket *sck)
645 assert(sck != NULL);
647 if (sck->m_endpoint != kOTInvalidEndpointRef )
649 sck->m_error = GSOCK_INVSOCK;
653 if (!sck->m_local)
655 sck->m_error = GSOCK_INVADDR;
660 sck->m_stream = FALSE;
661 sck->m_server = FALSE;
662 sck->m_oriented = FALSE;
668 sck->m_endpoint = socket(sck->m_local->m_realfamily, SOCK_DGRAM, 0);
669 socket_set_ref( sck->m_endpoint , (unsigned long) &gMacNetEvents , (unsigned long) sck ) ;
671 if (sck->m_endpoint == kOTInvalidEndpointRef )
673 sck->m_error = GSOCK_IOERR;
679 ioctl(sck->m_endpoint, FIONBIO, &arg);
681 _GSocket_Enable_Events(sck);
688 if ((bind(sck->m_endpoint, sck->m_local->m_addr, sck->m_local->m_len) != 0) ||
689 (getsockname(sck->m_endpoint,
690 sck->m_local->m_addr,
691 (WX_SOCKLEN_T *) &sck->m_local->m_len) != 0))
693 close(sck->m_endpoint);
694 sck->m_endpoint = -1;
695 sck->m_error = GSOCK_IOERR;
727 GSocketError GSocket_Connect(GSocket *sck, GSocketStream stream)
734 assert(sck != NULL);
737 sck->m_detected &= ~GSOCK_CONNECTION_FLAG;
739 if (sck->m_endpoint != kOTInvalidEndpointRef )
741 sck->m_error = GSOCK_INVSOCK;
745 if (!sck->m_peer)
747 sck->m_error = GSOCK_INVADDR;
752 sck->m_stream = (stream == GSOCK_STREAMED);
753 sck->m_oriented = TRUE;
754 sck->m_server = FALSE;
758 sck->m_endpoint =
761 sck->m_endpoint =
764 if ( sck->m_endpoint == kOTInvalidEndpointRef || err != kOTNoError )
766 sck->m_endpoint = kOTInvalidEndpointRef ;
767 sck->m_error = GSOCK_IOERR;
770 err = OTBind( sck->m_endpoint , nil , nil ) ;
775 SetDefaultEndpointModes( sck->m_endpoint , sck ) ;
778 ioctl(sck->m_endpoint, FIONBIO, &arg);
780 _GSocket_Enable_Events(sck);
782 _GAddress_translate_to( sck->m_peer , &addr ) ;
786 err = OTConnect( sck->m_endpoint , &peer , nil ) ;
795 if ((err == kOTNoDataErr ) && (!sck->m_non_blocking))
797 if (_GSocket_Output_Timeout(sck) == GSOCK_TIMEDOUT)
799 OTSndOrderlyDisconnect( sck->m_endpoint ) ;
800 sck->m_endpoint = kOTInvalidEndpointRef ;
801 /* sck->m_error is set in _GSocket_Output_Timeout */
810 getsockopt(sck->m_endpoint, SOL_SOCKET, SO_ERROR, (void*) &error, &len);
824 if ((err == kOTNoDataErr) && (sck->m_non_blocking))
826 sck->m_error = GSOCK_WOULDBLOCK;
833 OTSndOrderlyDisconnect( sck->m_endpoint ) ;
835 sck->m_endpoint = kOTInvalidEndpointRef ;
836 sck->m_error = GSOCK_IOERR;
839 // OTInetEventHandler(sck, T_CONNECT , kOTNoError , NULL ) ;