8 #ifndef FACEBOOK_NETWORK_STREAMING_CLIENT_H
9 #define FACEBOOK_NETWORK_STREAMING_CLIENT_H
104 inline const std::string& channel()
const;
110 inline const std::string& dataType()
const;
116 inline const Address4& serverAddress()
const;
122 inline const Port& serverPort()
const;
129 bool start(
const std::string& channel = std::string());
148 inline bool isReceiving();
154 inline bool isPaused();
232 bool isReceiving_ =
false;
235 bool isPaused_ =
false;
This class implements a recursive lock object.
Definition: Lock.h:31
This class wraps an address number with 32 bits.
Definition: Address4.h:26
uint32_t MessageId
Definition of a message id.
Definition: PackagedSocket.h:185
This class implements a packaged UDP server.
Definition: PackagedUDPServer.h:25
This class wraps a port number with 16 bits.
Definition: Port.h:26
This class implements a streaming client.
Definition: StreamingClient.h:35
bool isReceiving_
Determines whether the client is currently receiving.
Definition: StreamingClient.h:232
void onStart(const std::string &value, const SessionId sessionId)
Function handling start commands.
Callback< void, const void *, const size_t > ReceiveCallback
Definition of a callback function for streaming data.
Definition: StreamingClient.h:48
bool isReceiving()
Returns whether this client is currently receiving streaming data.
Definition: StreamingClient.h:269
bool stop()
Stops the streaming.
void onPause(const std::string &value, const SessionId sessionId)
Function handling pause commands.
const Port & serverPort() const
Returns the port of the connected streaming server.
Definition: StreamingClient.h:284
bool connect(const Address4 &address, const Port &port)
Connects the streaming client with a remote streaming server.
~StreamingClient()
Destructs a streaming client.
bool pause()
Pauses the streaming.
void setReceiveCallback(const ReceiveCallback &callback)
Sets the callback function for streaming data received from the streaming server.
Definition: StreamingClient.h:294
bool isConnected() const
Returns whether this client is currently connected with a streaming server.
StreamingClient()
Creates a new streaming client.
std::string channelDataType(const std::string &channel)
Returns a data type of a specified channel provides by the streaming server.
RequestCallback requestCallback_
Streaming server request callback function.
Definition: StreamingClient.h:250
const Address4 & serverAddress() const
Returns the address of the connected streaming server.
Definition: StreamingClient.h:279
const std::string & dataType() const
Returns the type of the streaming data.
Definition: StreamingClient.h:264
Address4 serverAddress_
Address4 of the streaming server.
Definition: StreamingClient.h:244
void onChangedDataType(const std::string &value, const SessionId sessionId)
Function handling changed data type commands.
void onUDPReceiveData(const Address4 &address, const Port &port, const void *data, const size_t size, const PackagedSocket::MessageId messageId)
Callback function for UDP receive message.
bool start(const std::string &channel=std::string())
(Re-)Starts the streaming.
Callback< bool, const State, const std::string & > RequestCallback
Definition of a callback function for streaming server requests.
Definition: StreamingClient.h:41
std::vector< std::string > Channels
Definition of a vector holding channels.
Definition: StreamingClient.h:53
PackagedUDPServer udpClient_
UDP client.
Definition: StreamingClient.h:238
void onTCPReceiveData(const void *data, const size_t size)
Callback function for TCP receive message.
ReceiveCallback receiveCallback_
Streaming data receive callback function.
Definition: StreamingClient.h:253
void onStop(const std::string &value, const SessionId sessionId)
Function handling stop commands.
Channels selectableChannels()
Returns a list of selectable channels provides by the streaming server.
const std::string & channel() const
Returns the selected channel of the streaming server.
Definition: StreamingClient.h:259
bool disconnect()
Disconnects the streaming client.
TCPClient tcpClient_
TCP client.
Definition: StreamingClient.h:241
Lock lock_
Client lock.
Definition: StreamingClient.h:256
std::string channel_
Stream channel.
Definition: StreamingClient.h:226
void onCommand(const std::string &command, const std::string &value, const SessionId sessionId)
New command function.
void setRequestCallback(const RequestCallback &callback)
Sets the callback function for streaming server requests (like e.g.
Definition: StreamingClient.h:289
Port serverPort_
Port of the streaming server.
Definition: StreamingClient.h:247
bool isPaused()
Returns whether this client is currently paused.
Definition: StreamingClient.h:274
bool isPaused_
Determines whether the client is pause.
Definition: StreamingClient.h:235
std::string dataType_
Stream data type.
Definition: StreamingClient.h:229
This class is the base class for all streaming objects.
Definition: Streaming.h:25
MessageQueue::Id SessionId
Definition of a session id.
Definition: Streaming.h:46
This class implements a TCP client.
Definition: TCPClient.h:27
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15