Metrologic Optimus S Programming Manual page 154

"c" programming guide
Table of Contents

Advertisement

148
"C" Programming Guide For Optimus S/R
fcntlsocket
gethostbyname
accept, getpeername, getsockname, listen, select, socket
See Also
To provide file control over descriptors.
Purpose
Syntax
int fcntlsocket (int fildes, int cmd, int arg);
Example
(?)
The routine provides for control over descriptors.
Description
The argument fildes is a descriptor to be operated on by cmd as described
below.
cmd
O_NDELAY
FNDELAY O_NDELAY synonym (?)
F_GETFL
F_SETFL
Depending on the value of cmd, it can take an additional third argument
arg.
If successful, it returns a non-negative value depending on cmd.
Return
Otherwise, it returns -1.
The global variable errno is set to indicate the error condition encountered.
See Also
Purpose
To get network host entry.
Syntax
struct hostent *gethostbname (const char *hnp);
hnp
Example
SOCKET s;
struct sockaddr_in name;
struct hostent *phostent;
s = socket (PF_INET, SOCK_STREAM, TCP);
if (s < 0) {
printf ("SOCKET allocation failed");
.......................
}
memset (&name, 0, sizeof (name));
non-blocking (?)
Get descriptor status flags (arg is ignored).
Set descriptor status flags to arg.
Pointer to a buffer containing a null-terminated host name

Advertisement

Table of Contents
loading

This manual is also suitable for:

Optimus r

Table of Contents