![]() | |
![]() | ![]() |
Entire Class Index | Main Class Index | Cross Index | Global Index |
CL_NetSession is the interface to communcation with a network session/game.
Contained in: global
Derived from:
none
Derived by:
none
Group: Network (NetSessions)
#include <ClanLib/network.h>
public function member index: |
||
Construction: |
||
CL_NetSession | (const std::string& app_id, int port); | |
CL_NetSession | (const std::string& app_id, const std::string& hostname, int port); | |
CL_NetSession | (const CL_ServerInfo& server); | |
CL_NetSession | (const CL_NetSession& copy); | |
virtual | ~CL_NetSession | (); |
Attributes: |
||
CL_EventTrigger* | get_trigger | (); |
CL_NetComputer& | get_server | (); |
CL_NetGroup& | get_all | (); |
bool | peek | (int channel) const; |
int | access_status | (int channel) const; |
bool | is_writable | (int channel) const; |
bool | is_readable | (int channel) const; |
Operations: |
||
void | operator = | (const CL_NetSession& session); |
CL_NetMessage | receive | (int channel, int timeout = -1); |
void | send | (const int dest_channel, const CL_NetGroup& dest, const CL_NetMessage& message, bool reliable = true); |
CL_NetComputer | receive_computer_leave | (); |
CL_NetComputer | receive_computer_join | (); |
CL_NetComputer | receive_computer_rejoin | (); |
bool | receive_session_closed | (); |
int | receive_access_changed | (); |
void | set_access | (int channel, const CL_NetGroup& group, int access_rights = ACCESS_CHANNEL_READ | ACCESS_CHANNEL_WRITE); |
Signals: |
||
CL_Signal_v2<CL_NetMessage& , int>& | sig_receive_message_default | (); |
CL_Signal_v1<CL_NetComputer>& | sig_computer_leave | (); |
CL_Signal_v1<CL_NetComputer>& | sig_computer_join | (); |
CL_Signal_v1<CL_NetComputer>& | sig_computer_rejoin | (); |
CL_Signal_v1<int>& | sig_access_changed | (); |
CL_Signal_v0& | sig_session_closed | (); |
Implementation: |
||
CL_NetSession | (class CL_NetSession_Generic* impl); | |
channel - Channel to look for a message.
timeout - Timeout, -1 means block forever.
Returns - The message received from the specified channel.
dest - The group of computers to receive the message.
dest_channel - Netchannel the message is sent to.
message - Data in the message sent. All the data from 'message' is duplicated before this function returns.
reliable - Arrival reliability. True guarantees arrival (use TCP/Pony express), false doesn't (use UDP/US Mail).
Returns - CL_NetMessage - The message received from the specified channel.
Returns - int - The channel the message was received in.