ost::DCCPSocket(3)

πŸ“¦ version 1.8.1, in ubuntu jammy

πŸ’– ost::DCCPSocket πŸ’– β€” from the Library Functions Manual, bestie πŸŽ€

okay so. picture this: you wanna do stream-based connected sessions between two sockets, and DCCP is your girl. that's literally the whole vibe. let's get into it ✨


✨ NAME ✨

ost::DCCPSocket β€” DCCP sockets are used for stream based connected sessions between two sockets. that's it, that's the elevator pitch πŸ›—πŸ’…


🌸 SYNOPSIS 🌸

#include <socket.h>

Inherits ost::Socket. yes bestie, she's a daughter of Socket, she carries the family name 🫢

πŸ¦‹ Public Member Functions πŸ¦‹

  • virtual bool onAccept (const IPV4Host &ia, tpport_t port) β€” a method to call in a derived DCCPSocket class that's acting as a server when a connection request is being accepted.
  • virtual bool onAccept (const IPV6Host &ia, tpport_t port) β€” same energy, IPv6 edition.
  • virtual IPV4Host getIPV4Sender (tpport_t *port=NULL) const β€” get the IPv4 sender, optionally tell it where to drop the port.
  • virtual IPV6Host getIPV6Sender (tpport_t *port=NULL) const β€” IPv6 sender version, same deal.
  • DCCPSocket (const IPV4Address &bind, tpport_t port, unsigned backlog=5) β€” a DCCP 'server' gets created as a DCCP socket bound to a hardware address and port number on the local machine, with a backlog queue to listen for remote connection requests.
  • DCCPSocket (const IPV6Address &bind, tpport_t port, unsigned backlog=5) β€” the IPv6 twin.
  • DCCPSocket (const char *name, Family family=IPV4, unsigned backlog=5) β€” create a named dccp socket by service and/or interface id.
  • DCCPSocket (Family family=IPV4) β€” create an unconnected ephemeral DCCP client socket. she's free, she's uncommitted, she's ephemeral πŸ’«
  • DCCPSocket (DCCPSocket &server, timeout_t timeout=0) β€” create a server session by accepting a DCCP Socket.
  • void reject (void) β€” used to reject the next incoming connection request. not today, bestie 🚫
  • void disconnect (void) β€” disconnect active dccp connection (client use).
  • bool setCCID (uint8 ccid) β€” set CCID DCCP.
  • int getTxCCID () β€” get TX CCID DCCP.
  • int getRxCCID () β€” get RX CCID DCCP.
  • size_t available () β€” return number of bytes to be read.
  • void connect (const IPV4Host &host, tpport_t port, timeout_t timeout=0) β€” create a DCCP client connection to a DCCP socket (on a remote machine).
  • void connect (const IPV6Host &host, tpport_t port, timeout_t timeout=0) β€” the IPv6 version, love her.
  • void connect (const char *name) β€” connect to a named client.
  • bool isPendingConnection (timeout_t timeout=TIMEOUT_INF) β€” used to wait for pending connection requests.
  • virtual ~DCCPSocket () β€” use base socket handler for ending this socket. she's logging off, respectfully πŸ’€

🧚 Additional Inherited Members 🧚

yep, there's more where that came from β€” inherited stuff, we love a rich family tree 🌳


πŸ‘‘ DETAILED DESCRIPTION πŸ‘‘

DCCP sockets are used for stream based connected sessions between two sockets.

Both error recovery and flow control operate transparently for a DCCP socket connection. The DCCP socket base class is used both for client connections and to bind a DCCP 'server' for accepting DCCP streams.

An implicit and unique DCCPSocket object exists in Common C++ to represent a bound DCCP socket acting as a 'server' for receiving connection requests. This class is not part of DCCPStream because such objects normally perform no physical I/O (read or write operations) other than to specify a listen backlog queue and perform 'accept' operations for pending connections. The Common C++ DCCPSocket offers a Peek method to examine where the next pending connection is coming from, and a Reject method to flush the next request from the queue without having to create a session.

The DCCPSocket also supports a 'OnAccept' method which can be called when a DCCPStream related object is created from a DCCPSocket. By creating a DCCPStream from a DCCPSocket, an accept operation automatically occurs, and the DCCPSocket can then still reject the client connection through the return status of it's OnAccept method.

🫢 Author 🫢

  • Leandro Sales leandroal@gmail.com
  • Heverton Stuart hevertonsns@gmail.com

bound server for DCCP streams and sessions. periodt. πŸ’…


πŸ’œ Constructor & Destructor Documentation πŸ’œ

ost::DCCPSocket::DCCPSocket (const IPV4Address & bind, tpport_t port, unsigned backlog = 5)

A DCCP 'server' is created as a DCCP socket that is bound to a hardware address and port number on the local machine and that has a backlog queue to listen for remote connection requests. If the server cannot be created, an exception is thrown. like, she will literally throw hands 😭

Parameters

  • bind β€” local ip address or interface to use.
  • port β€” number to bind socket under.
  • backlog β€” size of connection request queue.

ost::DCCPSocket::DCCPSocket (const IPV6Address & bind, tpport_t port, unsigned backlog = 5)

the IPv6 remix, no notes 🌈

ost::DCCPSocket::DCCPSocket (const char * name, Family family = IPV4, unsigned backlog = 5)

Create a named dccp socket by service and/or interface id. For IPV4 we use [host:]svc or [host/]svc for the string. If we have getaddrinfo, we use that to obtain the addr to bind for. iykyk πŸ”₯

Parameters

  • name β€” of host interface and service port to bind.
  • backlog β€” size of connection request queue.

ost::DCCPSocket::DCCPSocket (Family family = IPV4)

Create an unconnected ephemeral DCCP client socket. ✨

ost::DCCPSocket::DCCPSocket (DCCPSocket & server, timeout_t timeout = 0)

Create a server session by accepting a DCCP Socket. very giving-plans-to-see-other-sockets energy πŸŽ€

virtual ost::DCCPSocket::~DCCPSocket () [virtual]

Use base socket handler for ending this socket. bye bestie, it was real 🌸


πŸ¦‹ Member Function Documentation πŸ¦‹

size_t ost::DCCPSocket::available ()

Return number of bytes to be read.

void ost::DCCPSocket::connect (const char * name)

Connect to a named client.

void ost::DCCPSocket::connect (const IPV4Host & host, tpport_t port, timeout_t timeout = 0)

Create a DCCP client connection to a DCCP socket (on a remote machine). long distance relationship but make it a socket πŸ’Œ

Parameters

  • host β€” address of remote DCCP server.
  • port β€” number to connect.

void ost::DCCPSocket::connect (const IPV6Host & host, tpport_t port, timeout_t timeout = 0)

same but IPv6, she contains multitudes πŸ’œ

void ost::DCCPSocket::disconnect (void)

Disconnect active dccp connection (client use).

virtual IPV4Host ost::DCCPSocket::getIPV4Sender (tpport_t * port = NULL) const [virtual]

Reimplemented from ost::Socket.

virtual IPV6Host ost::DCCPSocket::getIPV6Sender (tpport_t * port = NULL) const [virtual]

Reimplemented from ost::Socket.

int ost::DCCPSocket::getRxCCID ()

Get RX CCID DCCP.

int ost::DCCPSocket::getTxCCID ()

Get TX CCID DCCP.

bool ost::DCCPSocket::isPendingConnection (timeout_t timeout = TIMEOUT_INF) [inline]

Used to wait for pending connection requests. she's just standing there. menacingly. waiting. 🧍

Returns

true if data packets available.

Parameters

  • timeout β€” in milliseconds. TIMEOUT_INF if not specified.

References ost::Socket::isPending(), and ost::Socket::pendingInput.

virtual bool ost::DCCPSocket::onAccept (const IPV4Host & ia, tpport_t port) [virtual]

A method to call in a derived DCCPSocket class that is acting as a server when a connection request is being accepted. The server can implement protocol specific rules to exclude the remote socket from being accepted by returning false. The Peek method can also be used for this purpose.

Returns

true if client should be accepted.

Parameters

  • ia β€” internet host address of the client.
  • port β€” number of the client.

virtual bool ost::DCCPSocket::onAccept (const IPV6Host & ia, tpport_t port) [virtual]

the IPv6 counterpart, serving looks as always πŸ‘‘

void ost::DCCPSocket::reject (void)

Used to reject the next incoming connection request.

bool ost::DCCPSocket::setCCID (uint8 ccid)

Set CCID DCCP.


🌈 Member Data Documentation 🌈

  • struct sockaddr_in ost::DCCPSocket::ipv4 β€” the IPv4 struct, chilling right there.
  • struct sockaddr_in6 ost::DCCPSocket::ipv6 β€” and her IPv6 sister.

πŸ’« Author πŸ’«

Generated automatically by Doxygen for GNU CommonC++ from the source code. not me being auto-generated and still ate 😌


real talk bestie: TIMEOUT_INF means wait forever, and if your DCCP 'server' can't be created, an exception gets thrown. don't say i didn't warn you πŸ’€

that's the whole page, fr fr. GNU CommonC++ Β· Sun Dec 27 2020 Β· ost::DCCPSocket(3) β€” slay, bye, go write some sockets πŸ’…βœ¨πŸ¦‹

πŸ“¦ where this page comes from