Fixed the AsyncAcceptor overload (too much c#..)
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user