|
| I have never seen this happen. Are you sure you aren't looking at netstat
| the wrong way, or that you aren't opening a TCP socket by accident?
|
| Jeroen "ShadowLord" Bogers
|


Here's the actual code:

//-----------------------------------------------------------------
int CIrisSockets::OpenSocket ( const char *sz_ipaddr, int iPort )
{
     char func_name[] = "CIrisSockets::OpenSocket ";

     // create a UDP socket.
     sockfd = socket(AF_INET, SOCK_DGRAM, 0);

     if (sockfd == SOCKET_ERROR)
     {
          PRINTF( "%s: Could not get socket descripter. '%d'\n",
       func_name, WSAGetLastError());

      return -1;
     }

     // assign an ip address and port number to the socket.
     address.sin_family = AF_INET;

     if (sz_ipaddr)
          address.sin_addr.s_addr = inet_addr(sz_ipaddr);
     else
          address.sin_addr.s_addr = htonl(INADDR_ANY);

     address.sin_port = htons(iPort);

     // open the new socket for business
     if (bind(sockfd, (SockAdr *) &address, sizeof(address)) ==
SOCKET_ERROR)
     {
          PRINTF("%s: Couldn't bind socket. '%d'\n", func_name,
WSAGetLastError());
          CloseSocket();
          return -1;
     }

     return 0;
}

// ------------- end code ---------------

The netstat command used was "netstat -an". I searched the news groups (deja
news) and found that,
others have experienced the same problem, but no cause or solution was
offered. This code works fine
under linux.

_______________________________________________
To unsubscribe, edit your list preferences, or view the list archives, please visit:
http://list.valvesoftware.com/mailman/listinfo/hlcoders

Reply via email to