diff options
Diffstat (limited to 'Swiften/Network/BoostConnectionServer.cpp')
| -rw-r--r-- | Swiften/Network/BoostConnectionServer.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/Swiften/Network/BoostConnectionServer.cpp b/Swiften/Network/BoostConnectionServer.cpp index f25f915..8db9656 100644 --- a/Swiften/Network/BoostConnectionServer.cpp +++ b/Swiften/Network/BoostConnectionServer.cpp | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * Copyright (c) 2010-2016 Isode Limited. | 2 | * Copyright (c) 2010-2018 Isode Limited. |
| 3 | * All rights reserved. | 3 | * All rights reserved. |
| 4 | * See the COPYING file for more information. | 4 | * See the COPYING file for more information. |
| 5 | */ | 5 | */ |
| @@ -19,10 +19,10 @@ | |||
| 19 | 19 | ||
| 20 | namespace Swift { | 20 | namespace Swift { |
| 21 | 21 | ||
| 22 | BoostConnectionServer::BoostConnectionServer(int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { | 22 | BoostConnectionServer::BoostConnectionServer(unsigned short port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { |
| 23 | } | 23 | } |
| 24 | 24 | ||
| 25 | BoostConnectionServer::BoostConnectionServer(const HostAddress &address, int port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : address_(address), port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { | 25 | BoostConnectionServer::BoostConnectionServer(const HostAddress &address, unsigned short port, std::shared_ptr<boost::asio::io_service> ioService, EventLoop* eventLoop) : address_(address), port_(port), ioService_(ioService), eventLoop(eventLoop), acceptor_(nullptr) { |
| 26 | } | 26 | } |
| 27 | 27 | ||
| 28 | void BoostConnectionServer::start() { | 28 | void BoostConnectionServer::start() { |
| @@ -37,10 +37,10 @@ boost::optional<BoostConnectionServer::Error> BoostConnectionServer::tryStart() | |||
| 37 | assert(!acceptor_); | 37 | assert(!acceptor_); |
| 38 | boost::asio::ip::tcp::endpoint endpoint; | 38 | boost::asio::ip::tcp::endpoint endpoint; |
| 39 | if (address_.isValid()) { | 39 | if (address_.isValid()) { |
| 40 | endpoint = boost::asio::ip::tcp::endpoint(address_.getRawAddress(), boost::numeric_cast<unsigned short>(port_)); | 40 | endpoint = boost::asio::ip::tcp::endpoint(address_.getRawAddress(), port_); |
| 41 | } | 41 | } |
| 42 | else { | 42 | else { |
| 43 | endpoint = boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v6(), boost::numeric_cast<unsigned short>(port_)); | 43 | endpoint = boost::asio::ip::tcp::endpoint(boost::asio::ip::tcp::v6(), port_); |
| 44 | } | 44 | } |
| 45 | acceptor_ = new boost::asio::ip::tcp::acceptor(*ioService_, endpoint); | 45 | acceptor_ = new boost::asio::ip::tcp::acceptor(*ioService_, endpoint); |
| 46 | if (endpoint.protocol() == boost::asio::ip::tcp::v6()) { | 46 | if (endpoint.protocol() == boost::asio::ip::tcp::v6()) { |
Swift