FBB::SocketBase(3bobcat)
π FBB::SocketBase β the bobcat manual page, bestie edition π
okay so welcome to FBB::SocketBase(3bobcat), like the manual page name is literally SocketBase(3bobcat) and it lives in the bobcat manual, and the vibe is: this is the Base class for sockets 𧦠(fr fr, that's the whole energy β it's the base class for socket-constructing classes).
β¨ NAME β¨
FBB::SocketBase β bestie, it's the Base class for socket-constructing classes π«Ά
πΈ SYNOPSIS πΈ
#include <bobcat/socketbase>
Linking option: -lbobcat
π¦ DESCRIPTION π¦
Okay so here's the tea β: this class is a base class for the FBB::ServerSocket and FBB::ClientSocket classes. And because it's designed as a base class β like, that's its whole identity, its main character energy β all its constructors are protected. Not public. Protected. Respect the boundaries bestie π
π NAMESPACE π
FBB
every constructor, member, operator and manipulator mentioned in this man-page is defined in the namespace FBB. all of them. no stragglers. periodt β¨
π INHERITS FROM π
FBB::InetAddress
π PROTECTED CONSTRUCTORS π
SocketBase(size_t port)β this constructor creates aSocketBaseto be used withServerSocket-objects, listening on port. πSocketBase(std::string const &host, uint16_t port)β this constructor creates aFBB::SocketBaseto be used with aClientSocket-object, connecting to hostname, at portport. π°οΈ
heads up! these constructors throw a std::exception if they could not properly complete. so like, if something's off, she's gonna yell. π
The copy constructor and copy assignment operator are available. Both offer protected access rights. π
π PROTECTED MEMBER π
SocketBase makeBase(int socket, sockaddr_in const &address)β this member returns aFBB::SocketBaseobject initializing its socket andFBB::InetAddressfrom the provided arguments. it's giving "build me from these ingredients" π§
π MEMBER FUNCTIONS π
All members of FBB::InetAddress are available, as FBB::SocketBase inherits from this class. (inheritance slay π)
bool debug() constβ this accessor returnstrueif the socket's debug (SO_DEBUG) socket option is active. It throws anFBB::Exceptionexception if the status of the debug option could not be determined;bool reuse() constβ this accessor returnstrueif the socket's reuse (SO_REUSEADDR) socket option is active. It throws anFBB::Exceptionexception 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 anFBB::Exceptionexception 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 anFBB::Exceptionexception if the socket's reuse option could not be modified;int socket() constβ this accessor returns theFBB::SocketBase's socket value. π
π§ EXAMPLE π§
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>
#include <bobcat/exception>
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. (go read it, it's good i promise π«Ά)
β FILES β
bobcat/socketbase β defines the class interface
π₯ SEE ALSO π₯
bobcat(7), clientsocket(3bobcat), inetaddress(3bobcat), localsocketbase(3bobcat), serversocket(3bobcat)
π BUGS π
None Reported. (not a single one. flawless. we love to see it β¨)
π BOBCAT PROJECT FILES π
https://fbb-git.gitlab.io/bobcat/: gitlab project page;
Debian Bobcat project files:
libbobcat6: debian package containing the shared library, changelog and copyright note;libbobcat-dev: debian package containing the static library, headers, manual pages, and developer info;
π©· BOBCAT π©·
Bobcat is an acronym of Brokkenβs Own Base Classes And Templates. (iykyk π)
πΈ COPYRIGHT πΈ
This is free software, distributed under the terms of the GNU General Public License (GPL). π«Ά
π AUTHOR π
Frank B. Brokken (f.b.brokken@rug.nl).
okay bestie that's the whole page, no cap π this was libbobcat-dev_6.15.01 dated 2005-2026 β shoutout to the bobcat era, she's been iconic since 2005 and she's still going, ate and left no crumbs, mwah π
β¨ππ¦
π¦ where this page comes from
- ubuntu stonking: libbobcat-dev 6.15.01-1 Β· GPL-3.0-or-later WITH OpenSSL exception
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms