Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

BOOL PIPXSocket::GetHostAddress ( const PString hostname,
Address addr 
) [static, inherited]

Get the IPX address for the specified host.

Returns:
TRUE if the IPX number was returned.
Parameters:
addr  Name of host to get address for. This may be either a server name or an IPX number in "colon" format. Variable to receive hosts IPX address

Definition at line 1100 of file winsock.cxx.

References PIPXSocket::Address::IsValid().

{
  addr = hostname;
  if (addr.IsValid())
    return TRUE;

  static GUID netware_file_server = SVCID_FILE_SERVER;
  CSADDR_INFO addr_info[10];
  DWORD buffer_length = sizeof(addr_info);
  int num = GetAddressByName(NS_DEFAULT,
                             &netware_file_server,
                             (LPTSTR)(const char *)hostname,
                             NULL,
                             0,
                             NULL,
                             addr_info,
                             &buffer_length,
                             NULL,
                             NULL
                            );
  if (num <= 0)
    return FALSE;

  AssignAddress(addr, *(sockaddr_ipx *)addr_info[0].RemoteAddr.lpSockaddr);
  return TRUE;
}


Generated by  Doxygen 1.6.0   Back to index