File: socketbase.yo

package info (click to toggle)
bobcat 6.11.00-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,292 kB
  • sloc: cpp: 21,370; fortran: 6,507; makefile: 2,787; sh: 724; perl: 401; ansic: 26
file content (95 lines) | stat: -rw-r--r-- 3,337 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
includefile(include/header)

COMMENT(manpage, section, releasedate, archive, short name)
manpage(FBB::SocketBase)(3bobcat)(_CurYrs_)(libbobcat-dev__CurVers_)
                    (Base class for sockets)

manpagename(FBB::SocketBase)(Base class for socket-constructing classes)

manpagesynopsis()
    bf(#include <bobcat/socketbase>)nl()
    Linking option: tt(-lbobcat)

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

includefile(include/namespace)

manpagesection(INHERITS FROM)
    bf(FBB::InetAddress)

manpagesection(PROTECTED CONSTRUCTORS)
    itemization(
    itb(SocketBase(size_t port))
       This constructor creates a bf(SocketBase) to be used with
        bf(ServerSocket)-objects, listening on tt(port).

    itb(SocketBase(std::string const &host, uint16_t port))
       This constructor creates a bf(FBB::SocketBase) to be used with a
        bf(ClientSocket)-object, connecting to tt(hostname), at port
        `tt(port)'.
    )

    These constructors throw a tt(std::exception) if they could not properly
    complete.

    The copy constructor and copy assignment operator are available. Both offer
    protected access rights.

manpagesection(PROTECTED MEMBER)
    itemization(
    itb(SocketBase makeBase(int socket, sockaddr_in const &address))
       This member returns  a bf(FBB::SocketBase) object initializing
        its socket and bf(FBB::InetAddress) from the provided arguments.
    )

manpagesection(MEMBER FUNCTIONS)
     All members of bf(FBB::InetAddress) are available, as bf(FBB::SocketBase)
inherits from this class.

    itemization(
    itb(bool debug() const)
        This accessor returns bf(true) if the socket's em(debug)
(bf(SO_DEBUG)) socket option is active. It throws an bf(FBB::Exception)
exception if the status of the debug option could not be determined;

    itb(bool reuse() const)
        This accessor returns bf(true) if the socket's em(reuse)
(bf(SO_REUSEADDR)) socket option is active. It throws an bf(FBB::Exception)
exception if the status of the reuse option could not be determined;

    itb(void setDebug(bool trueIsOn) const)
        This member may be used to modify the socket's em(debug)
(bf(SO_DEBUG)) socket option. It throws an bf(FBB::Exception) exception
if the socket's debug option could not be modified;

    itb(void setReuse(bool trueIsOn) const)
        This member may be used to modify the socket's em(reuse)
(bf(SO_REUSEADDR)) socket option. It throws an bf(FBB::Exception) exception
if the socket's reuse option could not be modified;

    itb(int socket() const)
        This accessor returns the bf(FBB::SocketBase)'s socket value.
    )

manpagesection(EXAMPLE)
    The classes tt(FBB::ClientSocket) and tt(FBB::ServerSocket) were derived
from tt(SocketBase). E.g.,
    verbinclude(../../clientsocket/clientsocket)

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

manpagefiles()
    em(bobcat/socketbase) - defines the class interface

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

manpagebugs()
    None Reported.

includefile(include/trailer)