MCPcopy Create free account
hub / github.com/boostorg/beast / main

Function main

example/websocket/client/async/websocket_client_async.cpp:197–223  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

195//------------------------------------------------------------------------------
196
197int main(int argc, char** argv)
198{
199 // Check command line arguments.
200 if(argc != 4)
201 {
202 std::cerr <<
203 "Usage: websocket-client-async <host> <port> <text>\n" <<
204 "Example:\n" <<
205 " websocket-client-async echo.websocket.org 80 \"Hello, world!\"\n";
206 return EXIT_FAILURE;
207 }
208 auto const host = argv[1];
209 auto const port = argv[2];
210 auto const text = argv[3];
211
212 // The io_context is required for all I/O
213 net::io_context ioc;
214
215 // Launch the asynchronous operation
216 std::make_shared<session>(ioc)->run(host, port, text);
217
218 // Run the I/O service. The call will return when
219 // the socket is closed.
220 ioc.run();
221
222 return EXIT_SUCCESS;
223}

Callers

nothing calls this directly

Calls 1

runMethod · 0.45

Tested by

no test coverage detected