libsocket
unixserverdgram.hpp
Go to the documentation of this file.
1 #ifndef LIBSOCKET_UNIXSERVERDGRAM_H_110A6B56F8A4414DAB6BE7B527FDA490
2 #define LIBSOCKET_UNIXSERVERDGRAM_H_110A6B56F8A4414DAB6BE7B527FDA490
3 
4 #include "unixdgram.hpp"
5 
6 #include <string>
7 
13 /*
14  The committers of the libsocket project, all rights reserved
15  (c) 2012, dermesser <lbo@spheniscida.de>
16 
17  Redistribution and use in source and binary forms, with or without
18  modification, are permitted provided that the following conditions are met:
19 
20  1. Redistributions of source code must retain the above copyright notice,
21  this list of conditions and the following disclaimer.
22  2. Redistributions in binary form must reproduce the above copyright notice,
23  this list of conditions and the following disclaimer in the documentation
24  and/or other materials provided with the distribution.
25 
26  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY
27  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
28  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
29  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
30  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
31  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
32  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
33  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
35  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36 
37 */
38 
39 namespace libsocket {
40 using std::string;
41 
51 class unix_dgram_server : public unix_dgram {
52  private:
53  bool bound;
54 
55  public:
56  unix_dgram_server(void);
57  unix_dgram_server(const char* bindpath, int socket_flags = 0);
58  unix_dgram_server(const string& bindpath, int socket_flags = 0);
59 
60  void setup(const char* bindpath, int socket_flags = 0);
61  void setup(const string& bindpath, int socket_flags = 0);
62 };
66 } // namespace libsocket
67 
68 #endif
Contains libsocket elements.
Definition: dgramclient.hpp:41
Provides an interface to UNIX-domain datagram sockets.
bool bound
Shows if the socket is already bound (for setup routines)
Generic class for all UNIX datagram (DGRAM) sockets, implementing i/o functions.
Definition: unixdgram.hpp:45
unix_dgram_server(void)
Void constructor.
void setup(const char *bindpath, int socket_flags=0)
Binds a socket.