| iMatix home page | << | < | > | >> |
SFL Version 2.11 |
Filename: sflsock.h
Package: Standard Function Library (SFL)
Written: 1996/02/03 iMatix SFL project team sfl@imatix.com
Revised: 1999/09/20
Copyright: Copyright (c) 1996-2000 iMatix Corporation
Provides functions to create, read, and write TCP and UDP sockets. Encapsulates system dependencies. Tested under MS Winsock, UNIX (Linux, AIX, SunOs), OpenVMS. Some of the code in this module was based on the book "Internetworking With TCP/IP Volume III: Client-Server Programming And Applications BSD Socket Version" by Douglas E. Comer and David L. Stevens, published 1993 by Prentice-Hall Inc. ISBN 0-13-020272-X. Defines sock_t which you should use for all sockets. If you need to call a native socket function, use a (SOCKET) cast on the sock_t handle.
sflsock.h defines these symbols, possibly conditionally:
Symbol: | Defined as: |
---|---|
AF_INET | 0 |
DNS_PORT | 53 /* Domain Name server port */ |
EAGAIN | EWOULDBLOCK |
ECONNRESET | (various) |
EINPROGRESS | (various) |
EPIPE | -1 |
EWOULDBLOCK | (various) |
FAKE_SOCKETS | 1 |
FD_CLR(d,set) | ((set)->__bits[__FDELT(d)] &= ~__FDMASK(d)) |
FD_ISSET(d,set) | ((set)->__bits[__FDELT(d)] & __FDMASK(d)) |
FD_SET(d,set) | ((set)->__bits[__FDELT(d)] |= __FDMASK(d)) |
FD_SETSIZE | 256 |
FD_SETTYPE | (various) |
FD_ZERO(set) | ((void) memset((void *) (set), 0, sizeof(fd_set))) |
INADDR_ANY | 0 |
INADDR_NONE | -1 /* constant */ |
INVALID_SOCKET | (sock_t) -1 /* Invalid socket handle */ |
IP_BADHOST | 2 /* Host not known */ |
IP_BADPROTOCOL | 4 /* Invalid protocol specified */ |
IP_BADSERVICE | 3 /* Service or port not known */ |
IP_BINDERROR | 7 /* Error binding socket */ |
IP_CONNECTERROR | 6 /* Error making connection */ |
IP_LISTENERROR | 8 /* Error preparing to listen */ |
IP_NOERROR | 0 /* No errors */ |
IP_NOSOCKETS | 1 /* Sockets not supported */ |
IP_SOCKETERROR | 5 /* Error creating socket */ |
MAXHOSTNAMELEN | 256 /* constant */ |
NFDBITS | (sizeof (unsigned long int) * 8) |
SFLSOCK_INCLUDED | TRUE |
SOCKET_ERROR | -1 /* Error on socket function */ |
SOCKET_LOOPBACK | 0x7f000001L /* Loopback address 127.0.0.1 */ |
__FDELT(d) | ((d) / NFDBITS) |
__FDMASK(d) | (1 << ((d) % NFDBITS)) |
htonl(x) | (various) |
htons(x) | (various) |
inet_addr(x) | 1 |
inet_ntoa(x) | "127.0.0.1" |
ntohl(x) | (various) |
ntohs(x) | (various) |
select(n,rf,wf,xf,t) | 1 |
sockerrno | (various) |
socket_hostaddr(handle) | socket_peeraddr (handle) |
Type name: | Defined as: |
---|---|
SOCKET | int |
argsize_t | (various) |
sock_t | qbyte |
| << | < | > | >> | Copyright © 1996-2000 iMatix Corporation |