libsocket
inetbase.hpp
Go to the documentation of this file.
1 #ifndef LIBSOCKET_INETBASE_H_6EDE111E3CDD4B07A94ECF4BD4E353C1
2 #define LIBSOCKET_INETBASE_H_6EDE111E3CDD4B07A94ECF4BD4E353C1
3 
4 #include <string>
5 #include "libinetsocket.h"
6 #include "socket.hpp"
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 
52 class inet_socket : public virtual socket {
53  protected:
55  string host;
57  string port;
59  int proto;
60 
61  public:
62  inet_socket();
63 
64  const string& gethost(void) const;
65  const string& getport(void) const;
66 };
70 } // namespace libsocket
71 
72 #endif
Contains libsocket elements.
Definition: dgramclient.hpp:41
const string & getport(void) const
Definition: inetbase.cpp:65
socket is the base class of every other libsocket++ object.
Definition: socket.hpp:71
Internet-socket base class This class provides some fields for all internet sockets,...
Definition: inetbase.hpp:52
string port
The port we're bound or connected to.
Definition: inetbase.hpp:57
int proto
Which internet protocol version we're using.
Definition: inetbase.hpp:59
const string & gethost(void) const
Definition: inetbase.cpp:59
string host
The address we're bound or connected to.
Definition: inetbase.hpp:55
Contains all functions available in the C libsocket.