🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: cn.bbs.comp.program
Article #2604

Re: ��λ�ñ����IP��ַ��(Visual C++)

#2604
From: ������
Date: Tue, 09 Dec 1997 00:00
43 lines
1751 bytes
struct hostent
{
   charFAR *h_name;
   charFAR * FAR * h_aliases;
   short   h_addrtype;
   short   h_length;
   char    Far * FAR *h_addr_list;
#define  h_addr   h_addr_list[0];  // Address, for backward compatibility

};

h_hame   :   �������ʽ����
h_aliases:   �ԡ�NULL����β���滻������
h_addrtype:  ���صĵ�ַ���ͣ���Windows Sockets��˵��������AF_INET;
h_length:    ÿ����ַ�ij��ȣ����ֽڣ�����AF-INET��˵����ֵ����4
addr_list:   �ԡ�NULL����β��һϵ�д�����ĵ�ַ��Windows Sockets �������ֽ�˳�򷵻���Щ��ַ��


�����µõ���

 LPHOSTENT  lpHostEnt;
 LPSTR      szIPAddr;

lpHostEnt = gethostbyname(....);

szIPAddr = inet_ntoa(*(LPIN_ADDR) * (lpHostEnt->h_addr_list));








�� �� quest (����) �Ĵ������ᵽ: ��
: �� �� netguy.bbs@bbs.whnet.edu.cn (������) �Ĵ������ᵽ: ��
: : man hostent
: 
: ���æ������һ��hostent�ĸ����δ��л��IP��ַ��
: 
--
�� ��Դ:����ˮ˼Դվ bbs.sjtu.edu.cn��[FROM: www]
Technical Details
Message-ID: <3M3g2D$Uve@bbs.sjtu.edu.cn>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: fc86e,9060e425a5e7e9a0,start
X-Google-Attributes: gidfc86e,public
From: surfering.bbs@bbs.sjtu.edu.cn (������)
Subject: Re: ��λ�ñ����IP��ַ��(Visual C++)
Date: 1997/12/09
Message-ID: <3M3g2D$Uve@bbs.sjtu.edu.cn>
X-Deja-AN: 296428866
X-Filename: program/M.881625709.A
Organization: ��ˮ˼Դվ
Newsgroups: cn.bbs.comp.program