libsocket
inetserverdgram.hpp
Go to the documentation of this file.
1 #ifndef LIBSOCKET_INETSERVERDGRAM_H_369D8FFD83DD4A78A5A2E3F12EFD0A60
2 #define LIBSOCKET_INETSERVERDGRAM_H_369D8FFD83DD4A78A5A2E3F12EFD0A60
3 
4 #include "inetbase.hpp"
5 #include "inetdgram.hpp"
6 
12 /*
13  The committers of the libsocket project, all rights reserved
14  (c) 2012, dermesser <lbo@spheniscida.de>
15 
16  Redistribution and use in source and binary forms, with or without
17  modification, are permitted provided that the following conditions are met:
18 
19  1. Redistributions of source code must retain the above copyright notice,
20  this list of conditions and the following disclaimer.
21  2. Redistributions in binary form must reproduce the above copyright notice,
22  this list of conditions and the following disclaimer in the documentation
23  and/or other materials provided with the distribution.
24 
25  THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS “AS IS” AND ANY
26  EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
27  WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
28  DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY
29  DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
30  (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
31  LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
32  ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
33  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
34  SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
35 
36 */
37 
38 namespace libsocket {
49 class inet_dgram_server : public inet_dgram {
50  public:
51  inet_dgram_server(const char* host, const char* port, int proto_osi3,
52  int flags = 0);
53  inet_dgram_server(const string& host, const string& port, int proto_osi3,
54  int flags = 0);
55 
56  private:
57  void setup(const char* host, const char* port, int proto_osi3,
58  int flags = 0);
59  void setup(const string& host, const string& port, int proto_osi3,
60  int flags = 0);
61 };
65 } // namespace libsocket
66 
67 #endif
Contains libsocket elements.
Definition: dgramclient.hpp:41
inet_dgram_server(const char *host, const char *port, int proto_osi3, int flags=0)
Create datagram socket and bind it.
string port
The port we're bound or connected to.
Definition: inetbase.hpp:57
void setup(const char *host, const char *port, int proto_osi3, int flags=0)
Set up socket. NOT FOR EXTERNAL USE
Base class for UDP/IP sockets.
Definition: inetdgram.hpp:60
string host
The address we're bound or connected to.
Definition: inetbase.hpp:55