/[resiprocate]/main/reTurn/AsyncUdpSocketBase.hxx
ViewVC logotype

Contents of /main/reTurn/AsyncUdpSocketBase.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 11159 - (show annotations) (download)
Fri Apr 25 14:03:32 2014 UTC (5 years, 6 months ago) by sgodin
File MIME type: text/plain
File size: 2938 byte(s)
-modified asio and boost include file ordering to avoid multiply defined symbol errors on linking
 -in preparation for upgrade of asio drop and support for latest boost 
 -include asio/ssh.hpp everywhere asio.hpp is included
 -include boost headers before others, to ensure we are not redefining stdint definitions in some includes
  and not others

1 #ifndef ASYNC_UDP_SOCKET_BASE_HXX
2 #define ASYNC_UDP_SOCKET_BASE_HXX
3
4 #include <asio.hpp>
5 #ifdef USE_SSL
6 #include <asio/ssl.hpp>
7 #endif
8 #include <boost/bind.hpp>
9
10 #include "AsyncSocketBase.hxx"
11
12 namespace reTurn {
13
14 class AsyncUdpSocketBase : public AsyncSocketBase
15 {
16 public:
17 AsyncUdpSocketBase(asio::io_service& ioService);
18 virtual ~AsyncUdpSocketBase();
19
20 virtual unsigned int getSocketDescriptor();
21
22 virtual asio::error_code bind(const asio::ip::address& address, unsigned short port);
23 virtual void connect(const std::string& address, unsigned short port);
24
25 virtual void transportReceive();
26 virtual void transportFramedReceive();
27 virtual void transportSend(const StunTuple& destination, std::vector<asio::const_buffer>& buffers);
28 virtual void transportClose();
29
30 virtual const asio::ip::address getSenderEndpointAddress();
31 virtual unsigned short getSenderEndpointPort();
32
33 protected:
34 asio::ip::udp::socket mSocket;
35 asio::ip::udp::resolver mResolver;
36
37 /// Endpoint info for current sender
38 asio::ip::udp::endpoint mSenderEndpoint;
39
40 virtual void handleUdpResolve(const asio::error_code& ec,
41 asio::ip::udp::resolver::iterator endpoint_iterator);
42
43 private:
44
45 };
46
47 }
48
49 #endif
50
51
52 /* ====================================================================
53
54 Copyright (c) 2007-2008, Plantronics, Inc.
55 All rights reserved.
56
57 Redistribution and use in source and binary forms, with or without
58 modification, are permitted provided that the following conditions are
59 met:
60
61 1. Redistributions of source code must retain the above copyright
62 notice, this list of conditions and the following disclaimer.
63
64 2. Redistributions in binary form must reproduce the above copyright
65 notice, this list of conditions and the following disclaimer in the
66 documentation and/or other materials provided with the distribution.
67
68 3. Neither the name of Plantronics nor the names of its contributors
69 may be used to endorse or promote products derived from this
70 software without specific prior written permission.
71
72 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
73 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
74 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
75 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
76 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
77 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
78 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
79 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
80 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
81 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
82 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
83
84 ==================================================================== */

Properties

Name Value
svn:eol-style native
svn:mime-type text/plain

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27