|
getprotobynumber
The Windows Sockets getprotobynumber function gets protocol information corresponding to a protocol number.
struct protoent FAR * getprotobynumber (
Parameters
number
[in] A protocol number, in host byte order.
Remarks
This function returns a pointer to a protoent structure as described above in getprotobyname. The contents of the structure correspond to the given protocol number.
The pointer which is returned points to a structure which is allocated by
Windows Sockets. The application must never attempt to modify this structure or to
free any of its components. Furthermore, only one copy of this structure is
allocated per thread, and so the application should copy any information which it
needs before issuing any other Windows Sockets function calls.
Return Values
If no error occurs, getprotobynumber returns a pointer to the protoent structure described above. Otherwise, it
returns a NULL pointer and a specific error number can be retrieved by calling WSAGetLastError.
Error Codes
WSANOTINITIALISED
| A successful WSAStartup must occur before using this function.
| WSAENETDOWN
| The network subsystem has failed.
| WSAHOST_NOT_FOUND
| Authoritative Answer Protocol not found.
| WSATRY_AGAIN
| Non-Authoritative Protocol not found, or server failure.
| WSANO_RECOVERY
| Nonrecoverable errors, the protocols database is not accessible.
| WSANO_DATA
| Valid name, no data record of requested type.
| WSAEINPROGRESS
| A blocking Windows Sockets 1.1 call is in progress, or the service provider is
still processing a callback function.
| WSAEINTR
| The (blocking) call was canceled through WSACancelBlockingCall.
|
See Also
getprotobyname, WSAAsyncGetProtoByNumber
Related Links
Software for Delphi and C++ Builder developers
Software for Visual Studio .NET developers
Software for Visual Basic 6 developers
Delphi Tips&Tricks
MegaDetailed.NET
More Online Helps
Win32 Programmer's Reference (win32.hlp)
Win32 Multimedia Programmer's Reference (mmedia.hlp)
OLE Programmer's Reference (ole.hlp)
Microsoft Windows Pen API Programmer's Reference (penapi.hlp)
Microsoft Windows Telephony API (TAPI) Programmer's Reference (tapi.hlp)
Unix Manual Pages
|