DataChannelServer
A C++ library for creating WebRTC DataChannel servers.
Classes | Typedefs | Functions
data_channel Namespace Reference

Classes

class  DataChannel
 A class which represents a single peer connection. More...
 
struct  DataChannelSettings
 DataChannelSettings specifies the settings for the created DataChannel. More...
 
class  Server
 A DataChannel server. More...
 

Typedefs

typedef std::function< void(std::shared_ptr< DataChannel >)> ConnectHandler
 
typedef std::function< void(const std::string &error)> ErrorHandler
 
typedef std::function< void(const std::string &message)> MessageHandler
 
typedef std::function< void()> CloseHandler
 

Functions

void Connect (const std::string &server, int port, ConnectHandler handler, ErrorHandler error_handler)
 Connect to a DataChannel Server. More...
 

Typedef Documentation

typedef std::function<void()> data_channel::CloseHandler
typedef std::function<void(std::shared_ptr<DataChannel>)> data_channel::ConnectHandler
typedef std::function<void(const std::string &error)> data_channel::ErrorHandler
typedef std::function<void(const std::string &message)> data_channel::MessageHandler

Function Documentation

void data_channel::Connect ( const std::string &  server,
int  port,
ConnectHandler  handler,
ErrorHandler  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.