Class that implements a TCP client socket. More...
#include <socket.h>

Public Member Functions | |
| Socket (iNetClass &netclass, bool wait_on_connect=false, bool blocking=false) | |
| Constructor. | |
| ~Socket () | |
| Destructor. | |
| void | Connect (const wxString &addr, const int port) |
| Connect to remote host. | |
| void | Disconnect () |
| Disconnect from remote host if connected. | |
| bool | Send (const wxString &data) |
| Send data over connection. | |
| wxString | Receive () |
| Receive data from connection. | |
| wxString | ReceiveSpecial () |
| used in plasmaservice, otherwise getting garbeld responses | |
| wxString | GetLocalAddress () const |
| used to retrieve local ip address behind NAT to communicate to the server on login | |
| wxString | GetHandle () |
| SockState | State () |
| Get curent socket state. | |
| SockError | Error () const |
| Get socket error code. | |
| void | SetSendRateLimit (int Bps=-1) |
| Set the maximum upload ratio. | |
| int | GetSendRateLimit () |
| void | OnTimer (int mselapsed) |
| void | SetTimeout (const int seconds) |
Protected Member Functions | |
| wxSocketClient * | _CreateSocket () |
| Creates an TCP socket and sets it up. | |
| bool | _Send (const wxString &data) |
| Internal send function. | |
Protected Attributes | |
| wxSocketClient * | m_sock |
| SocketEvents * | m_events |
| wxCriticalSection | m_lock |
| wxString | m_ping_msg |
| bool | m_connecting |
| bool | m_wait_on_connect |
| bool | m_blocking |
| iNetClass & | m_net_class |
| unsigned int | m_udp_private_port |
| int | m_rate |
| int | m_sent |
| std::string | m_buffer |
Class that implements a TCP client socket.
Definition at line 48 of file socket.h.
| Socket::Socket | ( | iNetClass & | netclass, | |
| bool | wait_on_connect = false, |
|||
| bool | blocking = false | |||
| ) |
Constructor.
Definition at line 66 of file socket.cpp.
| Socket::~Socket | ( | ) |
Destructor.
Definition at line 81 of file socket.cpp.
| wxSocketClient * Socket::_CreateSocket | ( | ) | [protected] |
Creates an TCP socket and sets it up.
Definition at line 90 of file socket.cpp.
| bool Socket::_Send | ( | const wxString & | data | ) | [protected] |
Internal send function.
Definition at line 165 of file socket.cpp.
| void Socket::Connect | ( | const wxString & | addr, | |
| const int | port | |||
| ) |
Connect to remote host.
Definition at line 117 of file socket.cpp.
| void Socket::Disconnect | ( | ) |
Disconnect from remote host if connected.
Definition at line 141 of file socket.cpp.
| SockError Socket::Error | ( | ) | const |
| wxString Socket::GetHandle | ( | ) |
Definition at line 235 of file socket.cpp.
| wxString Socket::GetLocalAddress | ( | ) | const |
used to retrieve local ip address behind NAT to communicate to the server on login
Definition at line 325 of file socket.cpp.
| void Socket::OnTimer | ( | int | mselapsed | ) |
Definition at line 344 of file socket.cpp.
| wxString Socket::Receive | ( | ) |
Receive data from connection.
Definition at line 194 of file socket.cpp.
| wxString Socket::ReceiveSpecial | ( | ) |
used in plasmaservice, otherwise getting garbeld responses
| bool Socket::Send | ( | const wxString & | data | ) |
Send data over connection.
Definition at line 156 of file socket.cpp.
| void Socket::SetSendRateLimit | ( | int | Bps = -1 |
) |
Set the maximum upload ratio.
Definition at line 338 of file socket.cpp.
| void Socket::SetTimeout | ( | const int | seconds | ) |
Definition at line 134 of file socket.cpp.
| SockState Socket::State | ( | ) |
Get curent socket state.
Definition at line 298 of file socket.cpp.
bool Socket::m_blocking [protected] |
std::string Socket::m_buffer [protected] |
bool Socket::m_connecting [protected] |
SocketEvents* Socket::m_events [protected] |
wxCriticalSection Socket::m_lock [protected] |
iNetClass& Socket::m_net_class [protected] |
wxString Socket::m_ping_msg [protected] |
int Socket::m_rate [protected] |
int Socket::m_sent [protected] |
wxSocketClient* Socket::m_sock [protected] |
unsigned int Socket::m_udp_private_port [protected] |
bool Socket::m_wait_on_connect [protected] |
1.6.3