summaryrefslogtreecommitdiff
path: root/src/anytun.cpp
diff options
context:
space:
mode:
authorMarkus Grüneis <gimpf@gimpf.org>2009-03-04 20:12:33 +0000
committerMarkus Grüneis <gimpf@gimpf.org>2009-03-04 20:12:33 +0000
commitf639165c84f8e341cccde7aef93d1d59f8b95336 (patch)
tree64ffd6597f119fe1301618561bbd75d92ee4f917 /src/anytun.cpp
parentupdated FreeBSD device (diff)
- extended gResolver: supports completion-callback
Diffstat (limited to 'src/anytun.cpp')
-rw-r--r--src/anytun.cpp16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/anytun.cpp b/src/anytun.cpp
index bd21eb3..1b71f15 100644
--- a/src/anytun.cpp
+++ b/src/anytun.cpp
@@ -213,7 +213,7 @@ void sender(void* p)
try {
param->src.send(encrypted_packet.getBuf(), encrypted_packet.getLength(), conn.remote_end_);
- } catch (std::exception& e) {
+ } catch (std::exception&) {
//TODO: do something here
//cLog.msg(Log::PRIO_ERROR) << "could not send data: " << e.what();
}
@@ -448,13 +448,17 @@ int main(int argc, char* argv[])
HostList connect_to = gOpt.getRemoteSyncHosts();
+
+
if(gOpt.getRemoteAddr() != "")
{
- boost::asio::io_service io_service;
- UDPPacketSource::proto::resolver resolver(io_service);
- UDPPacketSource::proto::resolver::query query(gOpt.getRemoteAddr(), gOpt.getRemotePort());
- UDPPacketSource::proto::endpoint endpoint = *resolver.resolve(query);
- createConnection(endpoint,gOpt.getSeqWindowSize(), gOpt.getMux());
+ gResolver.resolveUdp(gOpt.getRemoteAddr(), gOpt.getRemotePort(),
+ boost::bind(createConnection, _1, gOpt.getSeqWindowSize(), gOpt.getMux()));
+ ///*boost::asio::io_service io_service;
+ //UDPPacketSource::proto::resolver resolver(io_service);
+ //UDPPacketSource::proto::resolver::query query(gOpt.getRemoteAddr(), gOpt.getRemotePort());
+ //UDPPacketSource::proto::endpoint endpoint = *resolver.resolve(query);
+ //createConnection(endpoint,gOpt.getSeqWindowSize(), gOpt.getMux());*/
}
#ifndef NO_ROUTING