DataChannelServer
A C++ library for creating WebRTC DataChannel servers.
Functions
client.h File Reference

The emscripen client API for connecting to a DataChannel server. More...

Go to the source code of this file.

Functions

void data_channel::Connect (const std::string &server, int port, std::function< void(std::shared_ptr< DataChannel >)> handler, std::function< void(const std::string &error)> error_handler)
 Connect to a DataChannel Server. More...
 

Detailed Description

The emscripen client API for connecting to a DataChannel server.

Function Documentation

void data_channel::Connect ( const std::string &  server,
int  port,
std::function< void(std::shared_ptr< DataChannel >)>  handler,
std::function< void(const std::string &error)>  error_handler 
)
inline

Connect to a DataChannel Server.

Parameters
serverThe domain name of the server.
portThe port number of the server.
handlerA callback for when the connection occurs. NOTE: the provided shared_ptr ownes the connection and the connection will be closed when the shared_ptr is destroyed.
error_handlerA callback for errors while trying to connect.