#include <Csocket.h>
Public Types | |
| enum | ETConn { OUTBOUND = 0, LISTENER = 1, INBOUND = 2 } |
| enum | EFRead { READ_EOF = 0, READ_ERR = -1, READ_EAGAIN = -2, READ_CONNREFUSED = -3, READ_TIMEDOUT = -4 } |
| enum | EFSelect { SEL_OK = 0, SEL_TIMEOUT = -1, SEL_EAGAIN = -2, SEL_ERR = -3 } |
| enum | ESSLMethod { SSL23 = 0, SSL2 = 2, SSL3 = 3, TLS1 = 4 } |
| enum | ECONState { CST_START = 0, CST_DNS = CST_START, CST_BINDVHOST = 1, CST_DESTDNS = 2, CST_CONNECT = 3, CST_CONNECTSSL = 4, CST_OK = 5 } |
| enum | ECloseType { CLT_DONT = 0, CLT_NOW = 1, CLT_AFTERWRITE = 2, CLT_DEREFERENCE = 3 } |
| enum | { TMO_READ = 1, TMO_WRITE = 2, TMO_ACCEPT = 4, TMO_ALL = TMO_READ|TMO_WRITE|TMO_ACCEPT } |
| enum | EDNSLType { DNS_VHOST, DNS_DEST } |
Public Member Functions | |
| Csock (int iTimeout=60) | |
| Csock (const CS_STRING &sHostname, uint16_t uPort, int itimeout=60) | |
| virtual Csock * | GetSockObj (const CS_STRING &sHostname, uint16_t iPort) |
| virtual | ~Csock () |
| virtual void | Dereference () |
| virtual void | Copy (const Csock &cCopy) |
| Csock & | operator<< (const CS_STRING &s) |
| Csock & | operator<< (std::ostream &(*io)(std::ostream &)) |
| Csock & | operator<< (int32_t i) |
| Csock & | operator<< (uint32_t i) |
| Csock & | operator<< (int64_t i) |
| Csock & | operator<< (uint64_t i) |
| Csock & | operator<< (float i) |
| Csock & | operator<< (double i) |
| virtual bool | Connect () |
| virtual bool | Listen (uint16_t iPort, int iMaxConns=SOMAXCONN, const CS_STRING &sBindHost="", uint32_t iTimeout=0, bool bDetach=false) |
| virtual cs_sock_t | Accept (CS_STRING &sHost, uint16_t &iRPort) |
| virtual bool | AcceptSSL () |
| virtual bool | SSLClientSetup () |
| virtual bool | SSLServerSetup () |
| virtual bool | ConnectSSL () |
| bool | StartTLS () |
| virtual bool | Write (const char *data, size_t len) |
| virtual bool | Write (const CS_STRING &sData) |
| virtual cs_ssize_t | Read (char *data, size_t len) |
| CS_STRING | GetLocalIP () |
| CS_STRING | GetRemoteIP () |
| virtual bool | IsConnected () const |
| virtual void | SetIsConnected (bool b) |
| cs_sock_t & | GetRSock () |
| void | SetRSock (cs_sock_t iSock) |
| cs_sock_t & | GetWSock () |
| void | SetWSock (cs_sock_t iSock) |
| void | SetSock (cs_sock_t iSock) |
| cs_sock_t & | GetSock () |
| void | CallSockError (int iErrno, const CS_STRING &sDescription="") |
| virtual void | ResetTimer () |
| void | PauseRead () |
| void | UnPauseRead () |
| bool | IsReadPaused () |
| void | SetTimeout (int iTimeout, uint32_t iTimeoutType=TMO_ALL) |
| void | SetTimeoutType (uint32_t iTimeoutType) |
| int | GetTimeout () const |
| uint32_t | GetTimeoutType () const |
| virtual bool | CheckTimeout (time_t iNow) |
| virtual void | PushBuff (const char *data, size_t len, bool bStartAtZero=false) |
| CS_STRING & | GetInternalReadBuffer () |
| CS_STRING & | GetInternalWriteBuffer () |
| void | SetMaxBufferThreshold (uint32_t iThreshold) |
| uint32_t | GetMaxBufferThreshold () const |
| int | GetType () const |
| void | SetType (int iType) |
| const CS_STRING & | GetSockName () const |
| void | SetSockName (const CS_STRING &sName) |
| const CS_STRING & | GetHostName () const |
| void | SetHostName (const CS_STRING &sHostname) |
| uint64_t | GetStartTime () const |
| void | ResetStartTime () |
| uint64_t | GetBytesRead () const |
| void | ResetBytesRead () |
| uint64_t | GetBytesWritten () const |
| void | ResetBytesWritten () |
| double | GetAvgRead (uint64_t iSample=1000) |
| double | GetAvgWrite (uint64_t iSample=1000) |
| uint16_t | GetRemotePort () |
| uint16_t | GetLocalPort () |
| uint16_t | GetPort () |
| void | SetPort (uint16_t iPort) |
| void | Close (ECloseType eCloseType=CLT_NOW) |
| ECloseType | GetCloseType () |
| bool | IsClosed () |
| void | NonBlockingIO () |
| bool | GetSSL () |
| void | SetSSL (bool b) |
| const CS_STRING & | GetWriteBuffer () |
| void | ClearWriteBuffer () |
| bool | SslIsEstablished () |
| bool | ConnectInetd (bool bIsSSL=false, const CS_STRING &sHostname="") |
| bool | ConnectFD (int iReadFD, int iWriteFD, const CS_STRING &sName, bool bIsSSL=false, ETConn eDirection=INBOUND) |
| virtual void | SetParentSockName (const CS_STRING &sParentName) |
| const CS_STRING & | GetParentSockName () |
| virtual void | SetRate (uint32_t iBytes, uint64_t iMilliseconds) |
| uint32_t | GetRateBytes () |
| uint64_t | GetRateTime () |
| virtual void | Connected () |
| virtual void | Disconnected () |
| virtual void | Timeout () |
| virtual void | ReadData (const char *data, size_t len) |
| virtual void | ReadLine (const CS_STRING &sLine) |
| void | EnableReadLine () |
| void | DisableReadLine () |
| bool | HasReadLine () const |
| virtual void | ReachedMaxBuffer () |
| virtual void | SockError (int iErrno, const CS_STRING &sDescription) |
| virtual bool | ConnectionFrom (const CS_STRING &sHost, uint16_t iPort) |
| virtual void | Listening (const CS_STRING &sBindIP, uint16_t uPort) |
| virtual void | ConnectionRefused () |
| virtual void | ReadPaused () |
| time_t | GetTimeSinceLastDataTransaction (time_t iNow=0) |
| time_t | GetLastCheckTimeout () |
| time_t | GetNextCheckTimeout (time_t iNow=0) |
| virtual int | GetPending () |
| ECONState | GetConState () const |
| void | SetConState (ECONState eState) |
| bool | CreateSocksFD () |
| void | CloseSocksFD () |
| const CS_STRING & | GetBindHost () const |
| void | SetBindHost (const CS_STRING &sBindHost) |
| int | DNSLookup (EDNSLType eDNSLType) |
| bool | SetupVHost () |
| bool | GetIPv6 () const |
| void | SetIPv6 (bool b) |
| void | SetAFRequire (CSSockAddr::EAFRequire iAFRequire) |
| bool | AllowWrite (uint64_t &iNOW) const |
| void | SetSkipConnect (bool b) |
| virtual int | GetAddrInfo (const CS_STRING &sHostname, CSSockAddr &csSockAddr) |
| virtual int | ConvertAddress (const struct sockaddr_storage *pAddr, socklen_t iAddrLen, CS_STRING &sIP, uint16_t *piPort) |
| int | GetMaxConns () const |
The most basic level socket class. You can use this class directly for quick things or use the socket manager.
| anonymous enum |
| CLT_DONT |
don't close DER |
| CLT_NOW |
close immediatly |
| CLT_AFTERWRITE |
close after finishing writing the buffer |
| CLT_DEREFERENCE |
used after copy in Csock::Dereference() to cleanup a sock thats being shutdown |
| Csocket::Csock::Csock | ( | int | iTimeout = 60 | ) |
default constructor, sets a timeout of 60 seconds
| Csocket::Csock::Csock | ( | const CS_STRING & | sHostname, |
| uint16_t | uPort, | ||
| int | itimeout = 60 |
||
| ) |
Advanced constructor, for creating a simple connection.
| sHostname | the hostname your are connecting to |
| uPort | the port you are connecting to |
| itimeout | how long to wait before ditching the connection, default is 60 seconds |
| virtual Csocket::Csock::~Csock | ( | ) | [virtual] |
| virtual cs_sock_t Csocket::Csock::Accept | ( | CS_STRING & | sHost, |
| uint16_t & | iRPort | ||
| ) | [virtual] |
Accept an inbound connection, this is used internally.
| virtual bool Csocket::Csock::AcceptSSL | ( | ) | [virtual] |
Accept an inbound SSL connection, this is used internally and called after Accept.
| bool Csocket::Csock::AllowWrite | ( | uint64_t & | iNOW | ) | const |
returns true if this socket can write its data, primarily used with rate shaping, initialize iNOW to 0 and it sets it on the first call
| void Csocket::Csock::CallSockError | ( | int | iErrno, |
| const CS_STRING & | sDescription = "" |
||
| ) |
calls SockError, if sDescription is not set, then strerror is used to pull out a default description
| iErrno | the errno to send |
| sDescription | the description of the error that occurred |
| virtual bool Csocket::Csock::CheckTimeout | ( | time_t | iNow | ) | [virtual] |
returns true if the socket has timed out
| void Csocket::Csock::ClearWriteBuffer | ( | ) |
| void Csocket::Csock::Close | ( | ECloseType | eCloseType = CLT_NOW | ) |
just mark us as closed, the parent can pick it up
| void Csocket::Csock::CloseSocksFD | ( | ) |
puts the socks back to the state they were prior to calling CreateSocksFD
| virtual bool Csocket::Csock::Connect | ( | ) | [virtual] |
Create the connection, this is used by the socket manager, and shouldn't be called directly by the user.
| virtual void Csocket::Csock::Connected | ( | ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
Connected event
| bool Csocket::Csock::ConnectFD | ( | int | iReadFD, |
| int | iWriteFD, | ||
| const CS_STRING & | sName, | ||
| bool | bIsSSL = false, |
||
| ETConn | eDirection = INBOUND |
||
| ) |
Tie this guy to an existing real file descriptor.
| bool Csocket::Csock::ConnectInetd | ( | bool | bIsSSL = false, |
| const CS_STRING & | sHostname = "" |
||
| ) |
Use this to bind this socket to inetd.
| virtual bool Csocket::Csock::ConnectionFrom | ( | const CS_STRING & | sHost, |
| uint16_t | iPort | ||
| ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
Incoming Connection Event return false and the connection will fail default returns true
| virtual void Csocket::Csock::ConnectionRefused | ( | ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
Connection Refused Event
| virtual bool Csocket::Csock::ConnectSSL | ( | ) | [virtual] |
Create the SSL connection.
This is used by the socket manager, and shouldn't be called directly by the user.
| virtual int Csocket::Csock::ConvertAddress | ( | const struct sockaddr_storage * | pAddr, |
| socklen_t | iAddrLen, | ||
| CS_STRING & | sIP, | ||
| uint16_t * | piPort | ||
| ) | [virtual] |
retrieve name info (numeric only) for a given sockaddr_storage
| pAddr | the sockaddr_storage |
| iAddrLen | the length |
| sIP | filled with the IP from getnameinfo |
| piPort | if not null, filled with the port |
In the event you want to do additional work before or after getnameinfo is called, you can override this and do just that. One example is in the event that an ipv6 ip is a mapped ipv4 mapped, you can check like so.
| virtual void Csocket::Csock::Copy | ( | const Csock & | cCopy | ) | [virtual] |
use this to copy a sock from one to the other, override it if you have special needs in the event of a copy
| bool Csocket::Csock::CreateSocksFD | ( | ) |
grabs fd's for the sockets
| virtual void Csocket::Csock::Dereference | ( | ) | [virtual] |
in the event you pass this class to Copy(), you MUST call this function or on the original Csock other wise bad side effects will happen (double deletes, weird sock closures, etc) if you call this function and have not handled the internal pointers, other bad things can happend (memory leaks, fd leaks, etc) the whole point of this function is to allow this class to go away without shutting down
| void Csocket::Csock::DisableReadLine | ( | ) |
| virtual void Csocket::Csock::Disconnected | ( | ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
Disconnected event
| int Csocket::Csock::DNSLookup | ( | EDNSLType | eDNSLType | ) |
dns lookup
| void Csocket::Csock::EnableReadLine | ( | ) |
set the value of m_bEnableReadLine to true, we don't want to store a buffer for ReadLine, unless we want it
| virtual int Csocket::Csock::GetAddrInfo | ( | const CS_STRING & | sHostname, |
| CSSockAddr & | csSockAddr | ||
| ) | [virtual] |
override this call with your own DNS lookup method if you have one. By default this function is blocking
| sHostname | the hostname to resolve |
| csSockAddr | the destination sock address info |
| double Csocket::Csock::GetAvgRead | ( | uint64_t | iSample = 1000 | ) |
Get Avg Read Speed in sample milliseconds (default is 1000 milliseconds or 1 second)
| double Csocket::Csock::GetAvgWrite | ( | uint64_t | iSample = 1000 | ) |
Get Avg Write Speed in sample milliseconds (default is 1000 milliseconds or 1 second)
| const CS_STRING& Csocket::Csock::GetBindHost | ( | ) | const [inline] |
| uint64_t Csocket::Csock::GetBytesRead | ( | ) | const |
Gets the amount of data read during the existence of the socket.
| uint64_t Csocket::Csock::GetBytesWritten | ( | ) | const |
Gets the amount of data written during the existence of the socket.
| ECloseType Csocket::Csock::GetCloseType | ( | ) | [inline] |
| ECONState Csocket::Csock::GetConState | ( | ) | const [inline] |
returns the current connection state
| const CS_STRING& Csocket::Csock::GetHostName | ( | ) | const |
Returns a reference to the host name.
This gives access to the internal read buffer, if your not going to use ReadLine(), then you may want to clear this out (if its binary data and not many '\n')
This gives access to the internal write buffer. If you want to check if the send queue fills up, check here.
| bool Csocket::Csock::GetIPv6 | ( | ) | const [inline] |
| time_t Csocket::Csock::GetLastCheckTimeout | ( | ) | [inline] |
| uint16_t Csocket::Csock::GetLocalPort | ( | ) |
Returns the local port.
| uint32_t Csocket::Csock::GetMaxBufferThreshold | ( | ) | const |
| int Csocket::Csock::GetMaxConns | ( | ) | const [inline] |
returns the number of max pending connections when type is LISTENER
| time_t Csocket::Csock::GetNextCheckTimeout | ( | time_t | iNow = 0 | ) |
Returns the time when CheckTimeout() should be called next.
| const CS_STRING& Csocket::Csock::GetParentSockName | ( | ) |
| virtual int Csocket::Csock::GetPending | ( | ) | [virtual] |
return the data imediatly ready for read
| uint16_t Csocket::Csock::GetPort | ( | ) |
Returns the port.
| uint32_t Csocket::Csock::GetRateBytes | ( | ) |
| uint64_t Csocket::Csock::GetRateTime | ( | ) |
| uint16_t Csocket::Csock::GetRemotePort | ( | ) |
Returns the remote port.
returns a reference to the sock
| const CS_STRING& Csocket::Csock::GetSockName | ( | ) | const |
Returns a reference to the socket name.
| virtual Csock* Csocket::Csock::GetSockObj | ( | const CS_STRING & | sHostname, |
| uint16_t | iPort | ||
| ) | [virtual] |
override this for accept sockets
| bool Csocket::Csock::GetSSL | ( | ) |
Return true if this socket is using ssl. Note this does not mean the SSL state is finished, but simply that its configured to use ssl.
| uint64_t Csocket::Csock::GetStartTime | ( | ) | const |
Gets the starting time of this socket.
| int Csocket::Csock::GetTimeout | ( | ) | const |
| uint32_t Csocket::Csock::GetTimeoutType | ( | ) | const |
| time_t Csocket::Csock::GetTimeSinceLastDataTransaction | ( | time_t | iNow = 0 | ) |
return how long it has been (in seconds) since the last read or successful write
| int Csocket::Csock::GetType | ( | ) | const |
Returns the connection type from enum eConnType.
| const CS_STRING& Csocket::Csock::GetWriteBuffer | ( | ) |
Get the send buffer.
| bool Csocket::Csock::HasReadLine | ( | ) | const [inline] |
returns the value of m_bEnableReadLine, if ReadLine is enabled
| bool Csocket::Csock::IsClosed | ( | ) | [inline] |
References CLT_DONT, and GetCloseType().
| virtual bool Csocket::Csock::IsConnected | ( | ) | const [virtual] |
Tells you if the socket is connected.
| bool Csocket::Csock::IsReadPaused | ( | ) |
| virtual bool Csocket::Csock::Listen | ( | uint16_t | iPort, |
| int | iMaxConns = SOMAXCONN, |
||
| const CS_STRING & | sBindHost = "", |
||
| uint32_t | iTimeout = 0, |
||
| bool | bDetach = false |
||
| ) | [virtual] |
Listens for connections.
| iPort | the port to listen on |
| iMaxConns | the maximum amount of pending connections to allow |
| sBindHost | the vhost on which to listen |
| iTimeout | if no connections come in by this timeout, the listener is closed |
| bDetach | don't block waiting for port to come up, instead detach and return immediately |
| virtual void Csocket::Csock::Listening | ( | const CS_STRING & | sBindIP, |
| uint16_t | uPort | ||
| ) | [inline, virtual] |
called when type is LISTENER and the listening port is up and running
| sBindIP | the IP that is being bound to. Empty if no bind restriction |
| uPort | the listening port |
| void Csocket::Csock::NonBlockingIO | ( | ) |
Use this to change your fd's to blocking or none blocking.
| Csock& Csocket::Csock::operator<< | ( | std::ostream &(*)(std::ostream &) | io | ) |
| Csock& Csocket::Csock::operator<< | ( | int32_t | i | ) |
| Csock& Csocket::Csock::operator<< | ( | uint32_t | i | ) |
| Csock& Csocket::Csock::operator<< | ( | int64_t | i | ) |
| Csock& Csocket::Csock::operator<< | ( | uint64_t | i | ) |
| Csock& Csocket::Csock::operator<< | ( | float | i | ) |
| Csock& Csocket::Csock::operator<< | ( | double | i | ) |
| void Csocket::Csock::PauseRead | ( | ) |
will pause/unpause reading on this socket
| virtual void Csocket::Csock::PushBuff | ( | const char * | data, |
| size_t | len, | ||
| bool | bStartAtZero = false |
||
| ) | [virtual] |
pushes data up on the buffer, if a line is ready it calls the ReadLine event
| virtual void Csocket::Csock::ReachedMaxBuffer | ( | ) | [virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks This WARNING event is called when your buffer for readline exceeds the warning threshold and triggers this event. Either Override it and do nothing, or SetMaxBufferThreshold() This event will only get called if m_bEnableReadLine is enabled
| virtual cs_ssize_t Csocket::Csock::Read | ( | char * | data, |
| size_t | len | ||
| ) | [virtual] |
Read from the socket Just pass in a pointer, big enough to hold len bytes
| data | the buffer to read into |
| len | the size of the buffer |
| virtual void Csocket::Csock::ReadData | ( | const char * | data, |
| size_t | len | ||
| ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
Ready to read data event
| virtual void Csocket::Csock::ReadLine | ( | const CS_STRING & | sLine | ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks. With ReadLine, if your not going to use it IE a data stream,
Ready to Read a full line event
| virtual void Csocket::Csock::ReadPaused | ( | ) | [inline, virtual] |
This gets called every iteration of CSocketManager::Select() if the socket is ReadPaused
| void Csocket::Csock::ResetBytesRead | ( | ) |
| void Csocket::Csock::ResetBytesWritten | ( | ) |
| void Csocket::Csock::ResetStartTime | ( | ) |
Resets the start time.
| virtual void Csocket::Csock::ResetTimer | ( | ) | [virtual] |
resets the time counter, this is virtual in the event you need an event on the timer being Reset
| void Csocket::Csock::SetAFRequire | ( | CSSockAddr::EAFRequire | iAFRequire | ) | [inline] |
References Csocket::CSSockAddr::SetAFRequire().
| void Csocket::Csock::SetBindHost | ( | const CS_STRING & | sBindHost | ) | [inline] |
| void Csocket::Csock::SetConState | ( | ECONState | eState | ) | [inline] |
sets the connection state to eState
| void Csocket::Csock::SetHostName | ( | const CS_STRING & | sHostname | ) |
| void Csocket::Csock::SetIPv6 | ( | bool | b | ) | [inline] |
References Csocket::CSSockAddr::SetIPv6().
| virtual void Csocket::Csock::SetIsConnected | ( | bool | b | ) | [virtual] |
Sets the sock, telling it its connected (internal use only)
| void Csocket::Csock::SetMaxBufferThreshold | ( | uint32_t | iThreshold | ) |
sets the max buffered threshold when EnableReadLine() is enabled
| virtual void Csocket::Csock::SetParentSockName | ( | const CS_STRING & | sParentName | ) | [virtual] |
Get the peer's X509 cert.
Set The INBOUND Parent sockname
| void Csocket::Csock::SetPort | ( | uint16_t | iPort | ) |
| virtual void Csocket::Csock::SetRate | ( | uint32_t | iBytes, |
| uint64_t | iMilliseconds | ||
| ) | [virtual] |
sets the rate at which we can send data
| iBytes | the amount of bytes we can write |
| iMilliseconds | the amount of time we have to rate to iBytes |
| void Csocket::Csock::SetRSock | ( | cs_sock_t | iSock | ) |
| void Csocket::Csock::SetSkipConnect | ( | bool | b | ) | [inline] |
| void Csocket::Csock::SetSock | ( | cs_sock_t | iSock | ) |
| void Csocket::Csock::SetSockName | ( | const CS_STRING & | sName | ) |
| void Csocket::Csock::SetSSL | ( | bool | b | ) |
| void Csocket::Csock::SetTimeout | ( | int | iTimeout, |
| uint32_t | iTimeoutType = TMO_ALL |
||
| ) |
Currently this uses the same value for all timeouts, and iTimeoutType merely states which event will be checked for timeouts
| void Csocket::Csock::SetTimeoutType | ( | uint32_t | iTimeoutType | ) |
| void Csocket::Csock::SetType | ( | int | iType | ) |
| bool Csocket::Csock::SetupVHost | ( | ) |
this is only used on outbound connections, listeners bind in a different spot
| void Csocket::Csock::SetWSock | ( | cs_sock_t | iSock | ) |
| virtual void Csocket::Csock::SockError | ( | int | iErrno, |
| const CS_STRING & | sDescription | ||
| ) | [inline, virtual] |
A sock error occured event.
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
| virtual bool Csocket::Csock::SSLClientSetup | ( | ) | [virtual] |
This sets up the SSL Client, this is used internally.
| bool Csocket::Csock::SslIsEstablished | ( | ) |
is SSL_accept finished ? is the ssl properly finished (from write no error)
| virtual bool Csocket::Csock::SSLServerSetup | ( | ) | [virtual] |
This sets up the SSL Server, this is used internally.
| bool Csocket::Csock::StartTLS | ( | ) |
start a TLS connection on an existing plain connection
| virtual void Csocket::Csock::Timeout | ( | ) | [inline, virtual] |
Override these functions for an easy interface when using the Socket Manager Don't bother using these callbacks if you are using this class directly (without Socket Manager) as the Socket Manager calls most of these callbacks
Sock Timed out event
| void Csocket::Csock::UnPauseRead | ( | ) |
| virtual bool Csocket::Csock::Write | ( | const char * | data, |
| size_t | len | ||
| ) | [virtual] |
Write data to the socket.
If not all of the data is sent, it will be stored on an internal buffer, and tried again with next call to Write if the socket is blocking, it will send everything, its ok to check ernno after this (nothing else is processed)
| data | the data to send |
| len | the length of data |
| virtual bool Csocket::Csock::Write | ( | const CS_STRING & | sData | ) | [virtual] |
convenience function
1.7.6.1