DOKK / manpages / debian 10 / libbobcat-dev / socketbase.3bobcat.en
FBB::SocketBase(3bobcat) Base class for sockets FBB::SocketBase(3bobcat)

FBB::SocketBase - Base class for socket-constructing classes

#include <bobcat/socketbase>
Linking option: -lbobcat

This class is a base class for the FBB::ServerSocket and FBB::ClientSocket classes. Since it is designed as a base class, all its constructors are protected.

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

FBB::InetAddress

SocketBase(size_t port):
This constructor creates a SocketBase to be used with ServerSocket-objects, listening on port.
This constructor throws an Exception exception if it did not properly complete.
SocketBase(std::string const &host, uint16_t port):
This constructor creates a FBB::SocketBase to be used with a ClientSocket-object, connecting to hostname, at port `port’.
This constructor throws an Exception exception if it did not properly complete.
SocketBase(int socket, sockaddr_in const &address):
This constructor constructs a FBB::SocketBase object initializing its socket and FBB::InetAddress part from available external objects.

The (public) copy constructor is available.

All members of FBB::InetAddress are available, as FBB::SocketBase inherits from this class.

bool debug() const:
This accessor returns true if the socket’s debug (SO_DEBUG) socket option is active. It throws an FBB::Exception exception if the status of the debug option could not be determined.
bool reuse() const:
This accessor returns true if the socket’s reuse (SO_REUSEADDR) socket option is active. It throws an FBB::Exception exception if the status of the reuse option could not be determined.
void setDebug(bool trueIsOn) const:
This member may be used to modify the socket’s debug (SO_DEBUG) socket option. It throws an FBB::Exception exception if the socket’s debug option could not be modified.
void setReuse(bool trueIsOn) const:
This member may be used to modify the socket’s reuse (SO_REUSEADDR) socket option. It throws an FBB::Exception exception if the socket’s reuse option could not be modified.
int socket() const:
This accessor returns the FBB::SocketBase’s socket value.

The classes FBB::ClientSocket and FBB::ServerSocket were derived from SocketBase. E.g.,

#ifndef INCLUDED_BOBCAT_CLIENTSOCKET_
#define INCLUDED_BOBCAT_CLIENTSOCKET_
#include <string>
#include <bobcat/socketbase>
namespace FBB
{
class ClientSocket: public SocketBase
{

public:
// host may be address or name
ClientSocket(std::string const &host, uint16_t port);
int connect(); // returns fd (socket) to talk to the server }; } // FBB #endif

See the clientsocket(3bobcat) man-page for an example showing how to use FBB::ClientSocket.

bobcat/socketbase - defines the class interface

bobcat(7), clientsocket(3bobcat), inetaddress(3bobcat), localsocketbase(3bobcat), serversocket(3bobcat)

None Reported.

bobcat_4.08.06-x.dsc: detached signature;
bobcat_4.08.06-x.tar.gz: source archive;
bobcat_4.08.06-x_i386.changes: change log;
libbobcat1_4.08.06-x_*.deb: debian package holding the libraries;
libbobcat1-dev_4.08.06-x_*.deb: debian package holding the libraries, headers and manual pages;
http://sourceforge.net/projects/bobcat: public archive location;

Bobcat is an acronym of `Brokken’s Own Base Classes And Templates’.

This is free software, distributed under the terms of the GNU General Public License (GPL).

Frank B. Brokken (f.b.brokken@rug.nl).

2005-2018 libbobcat-dev_4.08.06-x.tar.gz