Fixed the AsyncAcceptor overload (too much c#..)

This commit is contained in:
leak
2014-07-07 22:09:17 +02:00
parent a738cd96dc
commit 1a9c183bc6
2 changed files with 8 additions and 5 deletions
+2 -2
View File
@@ -16,8 +16,8 @@
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __WORLDTCPSESSION_H__
#define __WORLDTCPSESSION_H__
#ifndef __WORLDSOCKET_H__
#define __WORLDSOCKET_H__
#include <memory>
#include <chrono>
+6 -3
View File
@@ -33,14 +33,17 @@ public:
AsyncAccept();
};
AsyncAcceptor(boost::asio::io_service& ioService, std::string bindIp, int port, bool tcpNoDelay) :
AsyncAcceptor(ioService, bindIp, port)
AsyncAcceptor(boost::asio::io_service& ioService, std::string bindIp, int port, bool tcpNoDelay) :
_socket(ioService),
_acceptor(ioService, tcp::endpoint(boost::asio::ip::address::from_string(bindIp), port))
{
_socket.set_option(boost::asio::ip::tcp::no_delay(tcpNoDelay));
AsyncAccept();
};
private:
void AsyncAcceptor::AsyncAccept()
void AsyncAccept()
{
_acceptor.async_accept(_socket, [this](boost::system::error_code error)
{