C++ Sockets 2.2.7 (Default branch)


 
Thread Tools Search this Thread
Special Forums News, Links, Events and Announcements Software Releases - RSS News C++ Sockets 2.2.7 (Default branch)
# 1  
Old 01-16-2008
C++ Sockets 2.2.7 (Default branch)

C++ Sockets is a cross-platform C++ wrapper for BSD-style sockets. It implements the TCP, UDP, ICMP, and SCTP transport layer protocols. Implemented application layer protocols are HTTP/HTTPS (using OpenSSL), SMTP (server), and Ajp/1.3 (server). Features include transparent SOCKS4 client support and asynchronous DNS. Included in the library are a number of HTTP client functions such as GET/PUT/POST, and also Web server framework components. License: GNU General Public License (GPL) Changes:
HTTP header names are no longer converted to lowercase. "setsockopt()" wrapper methods returning int values have been fixed. The query_string attribute of HttpRequest is no longer set when there is no query string present.Image

More...
Login or Register to Ask a Question

Previous Thread | Next Thread

1 More Discussions You Might Find Interesting

1. Programming

Help with sockets in C

if i have a server which wants to connect to exactly 5 clients, does that mean i need 5 socket file descriptors and use listen(socket_fd,1); for each one or just do listen(socket_fd,5) also whats the second parameter number mean? what happens if i put 0 there? also if i am connected... (28 Replies)
Discussion started by: omega666
28 Replies
Login or Register to Ask a Question
socket(2)							System Calls Manual							 socket(2)

NAME
socket() - create an endpoint for communication SYNOPSIS
AF_CCITT Only DESCRIPTION
The system call creates an endpoint for communication and returns a descriptor. The socket descriptor returned is used in all subsequent socket-related system calls. The af parameter specifies an address family to be used to interpret addresses in later operations that specify the socket. These address families are defined in the include files and The only currently supported address families are: AF_INET (DARPA Internet addresses) AF_INET6 (Internet Protocol version 6) AF_ROUTE (routing messages followed by IPv4 or IPv6 addresses) AF_UNIX (path names on a local node) AF_CCITT (CCITT X.25 addresses) AF_VME_LINK (backplane communications on VMEbus) The type specifies the semantics of communication for the socket. Currently defined types are: SOCK_STREAM Sequenced, reliable, two-way-connection-based byte streams. SOCK_DGRAM Datagrams (connectionless, unreliable messages of a fixed, typically small, maximum length). protocol specifies a particular protocol to be used with the socket. Normally, only a single protocol exists to support a particular socket type using a given address family. However, many protocols may exist, in which case a particular protocol must be specified. The protocol number to use depends on the communication domain in which communication is to take place (see services(4) and protocols(4)). protocol can be specified as zero, which causes the system to choose a protocol type to use. Sockets of type SOCK_STREAM are byte streams similar to pipes, except that they are full-duplex instead of half-duplex. A stream socket must be in a connected state before any data can be sent or received on it. A connection to another socket is created with a or call. Once connected, data can be transferred using some variant of the and or the and calls. When a session is complete, use or calls to termi- nate the connection. TCP, the communications protocol used to implement SOCK_STREAM for AF_INET or AF_INET6 sockets, ensures that data is not lost or dupli- cated. If a peer has buffer space for data and the data cannot be successfully transmitted within a reasonable length of time, the connec- tion is considered broken and the next call indicates an error with set to If is set and the connection has been idle for two hours, the TCP protocol sends "keepalive" packets every 75 seconds to determine whether the connection is active. These transmissions are not visible to users and cannot be read by a call. If the remote system does not respond within 10 minutes (after 8 "keepalive" packets have been sent), the next socket call returns an error with set to A signal is raised if a process sends on a broken stream. This causes naive pro- cesses that do not handle the signal to exit. An end-of-file condition (zero bytes read) is returned if a process tries to read on a bro- ken stream. SOCK_DGRAM sockets allow sending of messages to correspondents named in calls. It is also possible to receive messages at such a socket with The operation of sockets is controlled by socket level options set by the system call described by the getsockopt(2) manual entry. These options are defined in the file and explained in the getsockopt(2) manual entry. X.25 Only Socket endpoints for communication over an X.25/9000 link can be in either address family, AF_INET or AF_CCITT. If the socket is in the AF_INET family, the connection behaves as described above. TCP is used if the socket type is SOCK_STREAM. UDP is used if the socket type is SOCK_DGRAM. In both cases, Internet protocol (IP) and the X.25-to-IP interface module are used. If the socket is in the AF_CCITT address family, only the SOCK_STREAM socket type is supported. Refer to the topic "Comparing X.25 Level 3 Access to IP" in the for more details on the difference between programmatic access to X.25 via IP and X.25 Level 3. If the socket is in the AF_CCITT family, the connection and all other operations pass data directly from the application to the X.25 Packet Level (level 3) without passing through a TCP or UDP protocol. Connections of the AF_CCITT family cannot use most of the socket level options described in getsockopt(2). However, AF_CCITT connections can use many X.25-specific calls. X/Open Sockets Compilation Environment See xopen_networking(7). DEPENDENCIES
AF_CCITT and AF_VME_LINK Only the SOCK_STREAM type is supported. SCTP Only Stream Control Transmission Protocol (SCTP) provides two styles of interfaces for applications that want to communicate using SCTP as the transport protocol: one-to-one and one-to-many. The one-to-one style is similar to TCP mode of operation whereas the one-to-many style is similar to the UDP mode of operation. Applications can create a one-to-one style socket using the following syntax: or To create a one-to-many style socket, the syntax is: or The first form for both styles creates an endpoint which can use only IPv4 addresses. The second form creates an endpoint which can use both IPv6 and IPv4 addresses. For more details, see sctp(7). Note: SCTP is only available when the SCTP optional bundle is installed. RETURN VALUE
returns the following values: Successful completion. n is a valid file descriptor referring to the socket. Failure. is set to indicate the error. ERRORS
If fails, is set to one of the following values. The specified address family is not supported in this version of the system. The networking subsystem is not up. SOCK_DGRAM sockets are currently not supported for the AF_UNIX or AF_VME_LINK address families. The per-process descriptor table is full. The system's table of open files is temporarily full and no more calls can be accepted. No buffer space is available. The socket cannot be created. No memory is available. The socket cannot be created. The specified protocol is not supported. The type of socket and protocol do not match. The specified socket type is not supported in this address family. Connection timed out. WARNINGS
Not all possible values are documented in each socket related manpage due to dependencies from the underlying protocol modules. Refer to the errno(2) manpage for a complete list of error codes. Linking binary objects compiled to specification and binary objects compiled to specification to the same executable may result in unex- pected behavior, including application abnormal termination and unexpected socket errors. See xopen_networking(7) for details and remedy. FUTURE DIRECTION
Currently, the default behavior is the however, it might be changed to in a future release. At that time, any behavior that is incompati- ble with might be obsoleted. Applications that conform to the X/Open specification now will avoid migration problems (see xopen_network- ing(7)). AUTHOR
was developed by HP and the University of California, Berkeley. SEE ALSO
accept(2), bind(2), connect(2), getsockname(2), getsockopt(2), ioctl(2), listen(2), recv(2), select(2), send(2), shutdown(2), privi- leges(5), thread_safety(5), route(7P), socket(7), sctp(7), TCP(7P), UDP(7P), UNIX(7P), xopen_networking(7). STANDARDS CONFORMANCE
socket(2)