---
name: "socket.h"
section: "3cc"
platform: "linux"
package: "libcommoncpp2-dev"
version: "1.0.13-5"
release: "Debian 3.1 (Sarge)"
platforms: ["linux"]
url: "https://new.carta.tech/socket.h/3cc"
---

# socket.h(3cc)

Network addresses and sockets related classes.

## NAME

socket.h - Network addresses and sockets related classes.

## SYNOPSIS

`#include <cc++/config.h>`\
 `#include <cc++/thread.h>`\
 `#include <iostream>`\

### Compounds

class **BroadcastAddress**\
 *The broadcast address object is used to store the broadcast address for a specific subnet.* class **InetAddress**\
 *The network name and address objects are all derived from a common InetAddress base class. Internet Address binary data type.* class **InetAddrValidator**\
 *Classes derived from* **InetAddress** *would require an specific validator to pass to the* **InetAddress** *constructor. Abstract base class for derived inet addresses validators.* class **InetHostAddress**\
 *This object is used to hold the actual and valid internet address of a specific host machine that will be accessed through a socket. Address of a specific Internet host machine.* class **InetMaskAddress**\
 *Internet addresses used specifically as masking addresses (such as ' 255.255.255.0') are held in the InetMaskAddress derived object. Internet Address Mask such as subnet masks.* class **InetMcastAddress**\
 *A specialization of* **InetAddress** *that provides address validation for multicast addresses. A multicast network address.* class **InetMcastAddrValidator**\
 *Class for the function object that validates multicast addresses. Validating class specialized for multicast addresses.* class **Socket**\
 *The Socket is used as the base for all Internet protocol services under Common C++. base class of all sockets.* class **SocketPort**\
 *The socket port is an internal class which is attached to and then serviced by a specific* **SocketService** *'object'. base class for realtime and thread pool serviced protocols.* class **SocketService**\
 *The SocketService is a thread pool object that is meant to service attached socket ports.* **Thread** *pool service object for socket ports.* class **TCPSession**\
 *The TCP session is used to primarily to represent a client connection that can be managed on a seperate thread. Threaded streamable socket with non-blocking constructor.* class **TCPSocket**\
 *TCP sockets are used for stream based connected sessions between two sockets. bound server for TCP streams and sessions.* class **tcpstream**\
 *A more natural C++ 'tcpstream' class for use by non-threaded applications. C++ 'fstream' style tcpstream class.* class **TCPStream**\
 *TCP streams are used to represent TCP client connections to a server by TCP protocol servers for accepting client connections. streamable TCP socket connection.* class **UDPBroadcast**\
 *Representing a UDP socket used for subnet broadcasts, this class provides an alternate binding and* **setPeer()** *capability for UDP sockets. Unreliable Datagram for subnet broadcasts.* class **UDPDuplex**\
 *UDP duplex connections impliment a bi-directional point-to-point UDP session between two peer hosts. Unreliable Datagram Peer Associations.* class **UDPReceive**\
 *Representing half of a two-way UDP connection, the UDP receiver can receive data from another peer host or subnet. Unreliable Datagram Peer Associations.* class **UDPSocket**\
 *UDP sockets implement the TCP SOCK\_DGRAM UDP protocol. Unreliable Datagram Protocol sockets.* class **UDPTransmit**\
 *Representing half of a two-way UDP connection, the UDP transmitter can broadcast data to another selected peer host or to an entire subnet. Unreliable Datagram Peer Associations.*

### Defines

\#define **INVALID\_SOCKET**   -1\
 \#define **MSG\_DONTWAIT**   0\

### Typedefs

typedef int **SOCKET**\
 typedef unsigned short **tpport\_t**\
 *Transport Protocol Ports.*

### Functions

**CCXX\_EXPORT** (std::ostream &) operator\<\<(std\

### Variables

CCXX\_CLASS\_EXPORT **InetAddress**\
 CCXX\_CLASS\_EXPORT **InetHostAddress**\
 CCXX\_CLASS\_EXPORT **InetMaskAddress**\
 CCXX\_CLASS\_EXPORT **BroadcastAddress**\
 CCXX\_CLASS\_EXPORT **Socket**\
 CCXX\_CLASS\_EXPORT **UDPSocket**\
 CCXX\_CLASS\_EXPORT **UDPBroadcast**\
 CCXX\_CLASS\_EXPORT **UDPTransmit**\
 CCXX\_CLASS\_EXPORT **UDPReceive**\
 CCXX\_CLASS\_EXPORT **UDPDuplex**\
 CCXX\_CLASS\_EXPORT **TCPSocket**\
 CCXX\_CLASS\_EXPORT **TCPStream**\
 CCXX\_CLASS\_EXPORT **tcpstream**\
 CCXX\_CLASS\_EXPORT **TCPSession**\
 CCXX\_CLASS\_EXPORT **SocketPort**\
 CCXX\_CLASS\_EXPORT **SocketService**\

## DETAILED DESCRIPTION

Network addresses and sockets related classes.

## DEFINE DOCUMENTATION

### #define INVALID\_SOCKET -1

### #define MSG\_DONTWAIT 0

## TYPEDEF DOCUMENTATION

### typedef int SOCKET

### typedef unsigned short tpport\_t

Transport Protocol Ports.

## FUNCTION DOCUMENTATION

### CCXX\_EXPORT (std::ostream &)

## VARIABLE DOCUMENTATION

### class CCXX\_CLASS\_EXPORT BroadcastAddress

### class CCXX\_CLASS\_EXPORT InetAddress

### class CCXX\_CLASS\_EXPORT InetHostAddress

### class CCXX\_CLASS\_EXPORT InetMaskAddress

### class CCXX\_CLASS\_EXPORT Socket

### class CCXX\_CLASS\_EXPORT SocketPort

### class CCXX\_CLASS\_EXPORT SocketService

### class CCXX\_CLASS\_EXPORT TCPSession

### class CCXX\_CLASS\_EXPORT TCPSocket

### class CCXX\_CLASS\_EXPORT tcpstream

### class CCXX\_CLASS\_EXPORT TCPStream

### class CCXX\_CLASS\_EXPORT UDPBroadcast

### class CCXX\_CLASS\_EXPORT UDPDuplex

### class CCXX\_CLASS\_EXPORT UDPReceive

### class CCXX\_CLASS\_EXPORT UDPSocket

### class CCXX\_CLASS\_EXPORT UDPTransmit

## AUTHOR

Generated automatically by Doxygen for CommonC++ from the source code.
