AnCH Framework 0.1
Another C++ Hack Framework
 
Loading...
Searching...
No Matches
udpSocket.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#pragma once
21
22#include "network/socket.hpp"
23
24
25namespace anch::network {
26
32 class UdpSocket: public Socket {
33
34 public:
35 // Constructors +
40
49 UdpSocket(const std::string& ipAddress, uint16_t port);
50 // Constructors -
51
52 // Destructors +
56 virtual ~UdpSocket() noexcept;
57 // Destructors -
58
59 public:
60 // Methods +
66 virtual void listen();
67
74 virtual void connect();
75
84 virtual void accept(Socket& socket);
85
93 virtual void send(const std::string& message);
94
103 virtual void send(const std::string& message, const sockaddr_storage& peerAddr);
104
112 virtual void receive(std::string& message);
113 // Methods -
114
115 // Accessors +
121 virtual int getDomain() const;
122
128 virtual int getType() const;
129 // Accessors -
130
131 };
132
133}
Socket(SocketType type)
virtual void accept(Socket &socket)
virtual void receive(std::string &message)
UdpSocket(const std::string &ipAddress, uint16_t port)
virtual ~UdpSocket() noexcept
virtual int getType() const
virtual int getDomain() const
virtual void connect()
virtual void send(const std::string &message)
Network namespace.
Definition ioException.hpp:25