xHarbour Reference Documentation > Function Reference |
Creates an unbound datagram oriented socket.
INetDGram( [<lBroadcast>] ) --> pSocket
The functions returns a pointer to an unbound datagram socket.
Function INetDGram() creates an unbound socket configured for the User Datagram Protocol (UDP). The socket is able to send and eventually receive data. Since the socket is not bound, a program cannot retrieve the address at which the socket appears to be, but a second socket receiving a message sent from <pSocket> is able to reply correctly with a datagram that can be read from an unbound socket.
If <lBroadcast> is set to .T. (true) a broadcast capable socket is returned. However, this may require certain user privileges.
If the socket cannot be created, a socket error is set that can be analyzed with function INetErrorCode().
Note: refer to function INetDGramSend() for an example of datagram exchange between two processes.
See also: | INetDGramBind(), INetDGramRecv(), INetDGramSend() |
Category: | Datagram functions , Sockets functions , xHarbour extensions |
Source: | vm\INet.c |
LIB: | xhb.lib |
DLL: | xhbdll.dll |
http://www.xHarbour.com