VMS Help
CC, Socket Routines
*Conan The Librarian (sorry for the slow response - running on an old VAX)
|
|
Socket routines are used in writing Internet application
programs for the DEC TCP/IP Services for OpenVMS product
(formerly the VMS/ULTRIX Connection).
Accepts a connection on a socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int accept(int s, struct sockaddr *addr, int *addrlen);
_DECC_V4_SOURCE not defined:
int accept(int s, struct sockaddr *addr, size_t *addrlen);
Binds a name to a socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int bind(int s, struct sockaddr *name, int namelen);
_DECC_V4_SOURCE not defined:
int bind(int s, const struct sockaddr *name, size_t namelen);
Closes a connection and deletes a socket descriptor.
Syntax:
#include <unixio.h>
int close(s);
Initiates a connection on a socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int connect(int s, struct sockaddr *name, int namelen);
_DECC_V4_SOURCE not defined:
int connect(int s, const struct sockaddr *name, size_t namelen);
Returns the socket device channel associated with a socket
descriptor for direct use with the DEC TCP/IP Services for
OpenVMS product (formerly the VMS/ULTRIX Connection).
vaxc$get_sdc is a synonym for decc$get_sdc. Either name
invokes the same routine.
Syntax:
#include <socket.h>
short int decc$get_sdc(int s);
Ends retrieval of network host entries and closes the network host
file.
Syntax:
#include <netdb.h>
void endhostent (void);
Closes the networks database file.
Syntax:
#include <netdb.h>
void endnetent (void);
Returns the name of the connected peer.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int getpeername(int s, struct sockaddr *name, int *namelen);
_DECC_V4_SOURCE not defined:
int getpeername(int s, struct sockaddr *name, size_t *namelen);
Closes the protocols database file.
Syntax:
#include <netdb.h>
void endprotoent (void);
Closes the network services database file.
Syntax:
#include <netdb.h>
void endservent (void);
Searches the host database sequentially from the beginning of
the database for a host record with a given address.
Syntax:
#include <netdb.h>
struct hostent *gethostbyaddr(char *addr, int len, int type);
Searches the host database sequentially from the beginning of
the database for a host record with a given name or alias.
Syntax:
#include <netdb.h>
struct hostent *gethostbyname(char *name);
Opens the network host entry by name from the network host database
file.
Syntax:
#include <netdb.h>
struct hostent *gethostent (void);
Returns the name currently associated to the host.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int gethostname(char *name, int namelen);
_DECC_V4_SOURCE not defined:
int gethostname(char *name, size_t namelen);
Searches the network database sequentially from the beginning
of the database for a network record with a given address.
Syntax:
#include <netdb.h>
struct netent *getnetbyaddr(long net, int type);
Searches the network database sequentially from the beginning
of the database for a network record with a given name or alias.
Syntax:
#include <netdb.h>
struct netent *getnetbyname(char *name);
Gets a network file entry from the networks database file.
Syntax:
#include <netdb.h>
struct netent *getnetent (void);
Searches the protocols database until a matching protocol name
is found or until an EOF is encountered.
Syntax:
#include <netdb.h>
struct protoent *getprotobyname(char *name);
Searches the protocols database until a matching protocol number
is found or until an EOF is encountered.
Syntax:
#include <netdb.h>
struct protoent *getprotobynumber(int *proto);
Gets a protocol database entry from the protocols database file.
Syntax:
#include <netdb.h>
struct protoent *getprotonet (void);
Gets information on the named service from the network
services database. It searches the services database until
a matching service name is found or until an EOF is encountered.
If a non-null protocol name is also supplied, searches must
also match the protocol.
Syntax:
#include <netdb.h>
struct servent *getservbyname(char *name, char *proto);
Gets information on the specified port from the network
services database. It searches the services database until
a matching port is found or until an EOF is encountered.
If a non-null protocol name is also supplied, searches must
also match the protocol.
Syntax:
#include <netdb.h>
struct servent *getservbyport(int port, char *proto);
Gets a services file entry from the network services database file.
Syntax:
#include <netdb.h>
struct servent *getservent (void);
Returns the name associated with a socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int getsockname(int s, struct sockaddr *name, int *namelen);
_DECC_V4_SOURCE not defined:
int getsockname(int s, struct sockaddr *name, size_t *namelen);
Returns the options set on a socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int getsockopt(int s, int level, int optname, char *optval,
int *optlen);
_DECC_V4_SOURCE not defined:
int getsockopt(int s, int level, int optname, void *optval,
size_t *optlen);
Writes a message explaining a routine error.
Syntax:
#include <netdb.h>
extern int sys_nerr;
extern int h_errno;
void herror (const char *string);
Searches for host aliases associated with a name.
Syntax:
#include <types.h>
#include <in.h>
#include <namser.h>
#include <resolv.h>
char *hostalias (const char *name);
Accesses message explaining routine errors.
Syntax:
#include <string.h>
char *hstrerror (int errnum);
Converts longwords from host to network byte order.
Syntax:
#include <in.h>
unsigned long int htonl(unsigned long int hostlong);
Converts short integers from host to network byte order.
Syntax:
#include <in.h>
unsigned short int htons(unsigned short int hostshort);
Converts Internet addresses in text form into numeric (binary)
Internet addresses.
Syntax:
#include <in.h>
#include <inet.h>
int inet_addr(char *cp);
Returns the local network address portion of an Internet address.
Syntax:
#include <in.h>
#include <inet.h>
int inet_lnaof(struct in_addr in);
Returns an Internet address given a network address and a
local address on that network.
Syntax:
#include <in.h>
#include <inet.h>
struct in_addr inet_makeaddr(int net, int lna) ;
Returns the Internet network address portion of an Internet address.
Syntax:
#include <in.h>
#include <inet.h>
int inet_netof(struct in_addr in);
Converts a text string representing an Internet network address
in the standard Internet "." notation into an Internet network
address in network byte order.
Syntax:
#include <in.h>
#include <inet.h>
int inet_network(char *cp);
Converts an Internet address into a text string representing
the address in the standard Internet "." notation.
Syntax:
#include <in.h>
#include <inet.h>
char *inet_ntoa(struct in_addr in);
Controls socket operations only.
Syntax:
#include <ioctl.h>
int ioctl (int d, unsigned long request, void *arg);
Sets the maximum limit of outstanding connection requests for
a socket that is connection oriented.
Syntax:
int listen(int s, int backlog);
Converts longwords from network to host byte order.
Syntax:
#include <in.h>
unsigned long int ntohl(unsigned long int netlong) ;
Converts short integers from network to host byte order.
Syntax:
#include <in.h>
unsigned short int ntohs(unsigned short int netshort);
Reads bytes from a socket or file and places them in a buffer.
Syntax:
#include <unixio.h>
int read(int d, void *buffer, int nbytes);
Receives bytes from a connected socket and places them into a buffer.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int recv(int s, char *buf, int len, int flags);
_DECC_V4_SOURCE not defined:
ssize_t recv(int s, void *buf, size_t len, int flags);
Receives bytes from a socket from any source.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int recvfrom(int s, char *buf, int len, int flags, struct
sockaddr *from, int *fromlen);
_DECC_V4_SOURCE not defined:
ssize_t recvfrom(int s, void *buf, size_t len, int flags,
struct sockaddr *from, size_t *fromlen);
Receives bytes on a socket and places them into scattered buffers.
Syntax:
#include <types.h>
#include <socket.h>
int recvmsg(int s, struct msghdr msg[], int flags);
Allows you to poll or check a group of sockets for I/O
activity. It can check what sockets are ready to be read or
written, or what sockets have a pending exception.
Syntax:
#include <time.h>
_DECC_V4_SOURCE defined:
int select(int nfds, int *readfds, int *writefds,
int *exceptfds, struct timeval *timeout);
_DECC_V4_SOURCE not defined:
int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout);
Sends bytes through a socket to its connected peer.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int send(int s, char *msg, int len, int flags);
_DECC_V4_SOURCE not defined:
ssize_t send(int s, const void *msg, size_t len, int flags);
Sends gathered bytes through a socket to any other socket.
Syntax:
#include <types.h>
#include <socket.h>
int sendmsg(int s, struct msghdr msg[], int flags);
Sends bytes through a socket to any other socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int sendto(int s, char *msg, int len, int flags, struct
sockaddr *to, int tolen);
_DECC_V4_SOURCE not defined:
ssize_t sendto(int s, const void *msg, size_t len, int flags,
const struct sockaddr *to, size_t tolen);
Opens, rewinds, and closes the network host database file.
Syntax:
#include <netdb.h>
void sethostent (int stay_open);
Opens, rewinds, or closes the networks database file.
Syntax:
#include <netdb.h>
void setnetent (int stay_open);
Opens, rewinds, or closes the protocols database file.
Syntax:
#include <netdb.h>
void setprotoent (int stay_open);
Opens, rewinds, or closes the network services database.
Syntax:
#include <netdb.h>
void setservent (int stay_open);
Sets options on a socket.
Syntax:
#include <types.h>
#include <socket.h>
_DECC_V4_SOURCE defined:
int setsockopt(int s, int level, int optname, char *optval,
int optlen);
_DECC_V4_SOURCE not defined:
int setsockopt(int s, int level, int optname, const void *optval,
size_t optlen);
Shuts down all or part of a bidirectional connection on a socket.
It can disallow further receives, further sends, or both.
Syntax:
#include <socket.h>
int shutdown(int s, int how);
Creates an endpoint for communication by returning a special
kind of file descriptor called a socket descriptor, which is
associated with a DEC TCP/IP Services for OpenVMS socket device
channel.
Syntax:
#include <types.h>
#include <socket.h>
int socket(int af, int type, int protocol);
Returns the socket descriptor associated with a Socket Device
Channel for direct use with the Compaq C RTL.
Syntax:
#include <socket.h>
int decc$socket_fd (int channel);
Returns the socket device channel associated with a socket
descriptor for direct use with the DEC TCP/IP Services for
OpenVMS product (formerly the VMS/ULTRIX Connection).
vaxc$get_sdc is a synonym for decc$get_sdc. Either name
invokes the same routine.
Syntax:
#include <socket.h>
short int vaxc$get_sdc(int s);
Writes a buffer of data to a socket or file.
Syntax:
#include <unixio.h>
int write(int d, void *buffer, int nbytes);
[legal]
[privacy]
[GNU]
[policy]
[netiquette]
[sponsors]
[FAQ]
Polarhome, production since 1999.
Member of Polarhome portal.