active socket
This commit is contained in:
parent
34860ac25f
commit
032dc6db56
|
@ -33,5 +33,11 @@ target_link_libraries(server_endpoint PRIVATE Threads::Threads)
|
|||
|
||||
add_executable(active_socket
|
||||
active_socket.cpp
|
||||
src/sdk.h)
|
||||
src/sdk.h
|
||||
passive_socket.cpp)
|
||||
target_link_libraries(active_socket PRIVATE Threads::Threads)
|
||||
|
||||
add_executable(passive_socket
|
||||
passive_socket.cpp
|
||||
src/sdk.h)
|
||||
target_link_libraries(passive_socket PRIVATE Threads::Threads)
|
||||
|
|
|
@ -0,0 +1,27 @@
|
|||
#include "src/sdk.h"
|
||||
#include <boost/asio.hpp>
|
||||
#include <iostream>
|
||||
|
||||
using namespace boost;
|
||||
namespace sys = boost::system;
|
||||
namespace net = boost::asio;
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
{
|
||||
net::io_service ios;
|
||||
net::ip::tcp protocol = net::ip::tcp::v6();
|
||||
net::ip::tcp::acceptor acceptor(ios);
|
||||
sys::error_code ec;
|
||||
|
||||
acceptor.open(protocol, ec);
|
||||
|
||||
if (ec.value())
|
||||
{
|
||||
cout << "Error"s << endl;
|
||||
|
||||
return ec.value();
|
||||
}
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in New Issue