AnCH Framework  0.1
Another C++ Hack Framework
tcpSocket.hpp
1 /*
2  ANCH Framework: ANother C++ Hack is a C++ framework based on C++11 standard
3  Copyright (C) 2012 Vincent Lachenal
4 
5  This file is part of ANCH Framework.
6 
7  ANCH Framework is free software: you can redistribute it and/or modify
8  it under the terms of the GNU Lesser General Public License as published by
9  the Free Software Foundation, either version 3 of the License, or
10  (at your option) any later version.
11 
12  ANCH Framework is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU Lesser General Public License for more details.
16 
17  You should have received a copy of the GNU Lesser General Public License
18  along with ANCH Framework. If not, see <http://www.gnu.org/licenses/>.
19 */
20 #ifndef _ANCH_NETWORK_TCP_SOCKET_H_
21 #define _ANCH_NETWORK_TCP_SOCKET_H_
22 
23 #include "network/socket.hpp"
24 
25 namespace anch {
26  namespace network {
27 
33  class TcpSocket: public Socket {
34 
35  private:
36  // Attributes +
37  // Attributes -
38 
39  public:
40  // Constructors +
44  TcpSocket();
45 
54  TcpSocket(const std::string& ipAddress, uint16_t port)
56  // Constructors -
57 
58  // Destructors +
62  virtual ~TcpSocket() noexcept;
63  // Destructors -
64 
65  public:
66  // Methods +
74  virtual void send(const std::string& message) throw(anch::network::IOException);
75 
83  virtual void receive(std::string& message) throw(anch::network::IOException);
84  // Methods -
85 
86  // Accessors +
92  virtual int getDomain() const;
93 
99  virtual int getType() const;
100  // Accessors -
101 
102  };
103 
104  }
105 }
106 
107 #endif // _ANCH_NETWORK_TCP_SOCKET_H_
virtual void receive()
Definition: socket.cpp:224
AnCH framework base namespace.
Definition: base64.hpp:28
virtual void send(const std::string &message)
Definition: tcpSocket.cpp:80
Definition: tcpSocket.hpp:33
virtual int getDomain() const
Definition: tcpSocket.cpp:124
virtual int getType() const
Definition: tcpSocket.cpp:134
TcpSocket()
Definition: tcpSocket.cpp:42
Definition: socket.hpp:93
virtual ~TcpSocket() noexcept
Definition: tcpSocket.cpp:65
Definition: ioException.hpp:34