Functions | |
Int32 | GeIpInitNetwork () |
void | GeIpCloseNetwork () |
IpConnection * | GeIpOpenListener (UInt32 ipAddr, Int32 port, BaseThread *thread, Int32 timeout, Bool dontwait, Int32 *ferr) |
IpConnection * | GeIpWaitForIncoming (IpConnection *listener, BaseThread *connection, Int32 *ferr) |
IpConnection * | GeIpOpenOutgoing (const Char *hostname, BaseThread *thread, Int32 initial_timeout, Int32 timeout, Bool dontwait, Int32 *ferr, Int32 retries) |
void | GeIpCloseConnection (IpConnection *&ipc) |
void | GeIpKillConnection (IpConnection *ipc) |
Int32 | GeIpBytesInInputBuffer (IpConnection *ipc) |
Int | GeIpReadBytes (IpConnection *ipc, void *buf, Int size) |
Int | GeIpSendBytes (IpConnection *ipc, void *buf, Int size) |
void | GeIpGetHostAddr (IpConnection *ipc, Char *buf, Int32 bufsize) |
void | GeIpGetRemoteAddr (IpConnection *ipc, Char *buf, Int32 bufsize) |
void | GeRandomSleep (Int32 min, Int32 max) |
String | GetTimeString () |
Bool | GetMACaddress (UChar *buf, Int32 bufsize) |
Int32 cineware::GeIpInitNetwork | ( | ) |
Initializes the network.
void cineware::GeIpCloseNetwork | ( | ) |
Closes the network.
IpConnection* cineware::GeIpOpenListener | ( | UInt32 | ipAddr, |
Int32 | port, | ||
BaseThread * | thread, | ||
Int32 | timeout, | ||
Bool | dontwait, | ||
Int32 * | ferr | ||
) |
Opens an IP listener.
[in] | ipAddr | The IP address of the network interface to use for the listener, or 0 to use the default interface. |
[in] | port | The port of the listener. |
[in] | thread | The thread to use for the connection. The caller owns the pointed thread. |
[in] | timeout | The time after which the listener closes an unresponsive connection. |
[in] | dontwait | If true, the TCP/IP flag TCP_NODELAY is set. Quote from the WinSock documentation: "The TCP_NODELAY option disables the Nagle algorithm. The Nagle algorithm is used to reduce the number of small packets sent by a host by buffering unacknowledged send data until a full-size packet can be sent. However, for some applications this algorithm can impede performance, and TCP_NODELAY may be used to turn it off. Application writers should not set TCP_NODELAY unless the impact of doing so is well-understood and desired, since setting TCP_NODELAY can have a significant negative impact of network performance. TCP_NODELAY is the only supported socket option which uses level IPPROTO_TCP; all other options use level SOL_SOCKET." |
[in] | ferr | The function error status. Assigned a value different than 0 to indicate failure. |
IpConnection* cineware::GeIpWaitForIncoming | ( | IpConnection * | listener, |
BaseThread * | connection, | ||
Int32 * | ferr | ||
) |
Waits for an incoming connection to listener.
[in] | listener | The listener IP connection to wait for. Needs to be freed with GeIpCloseConnection(). The caller owns the pointed IpConnection. |
[in] | connection | The thread to use for the connection. The caller owns the pointed thread. |
[in] | ferr | The function error status. Assigned a value different than 0 to indicate failure. |
IpConnection* cineware::GeIpOpenOutgoing | ( | const Char * | hostname, |
BaseThread * | thread, | ||
Int32 | initial_timeout, | ||
Int32 | timeout, | ||
Bool | dontwait, | ||
Int32 * | ferr, | ||
Int32 | retries | ||
) |
Opens an outgoing IP connection.
[in] | hostname | The hostname to connect to. Should include port, e.g. "www.maxon.de:80" or "192.168.0.37:80". |
[in] | thread | The thread to use for the connection. The caller owns the pointed thread. |
[in] | initial_timeout | The timeout for creating the connection. |
[in] | timeout | The timeout for the data transfer. |
[in] | dontwait | If true, the TCP/IP flag TCP_NODELAY is set. Quote from the WinSock documentation: "The TCP_NODELAY option disables the Nagle algorithm. The Nagle algorithm is used to reduce the number of small packets sent by a host by buffering unacknowledged send data until a full-size packet can be sent. However, for some applications this algorithm can impede performance, and TCP_NODELAY may be used to turn it off. Application writers should not set TCP_NODELAY unless the impact of doing so is well-understood and desired, since setting TCP_NODELAY can have a significant negative impact of network performance. TCP_NODELAY is the only supported socket option which uses level IPPROTO_TCP; all other options use level SOL_SOCKET." |
[in] | ferr | The function error status. Assigned a value different than 0 to indicate failure. |
[in] | retries | Defines how many times the function tries to connect. |
void cineware::GeIpCloseConnection | ( | IpConnection *& | ipc | ) |
Closes and frees an IP connection.
[in] | ipc | The IP connection to close. Assigned nullptr afterwards. |
void cineware::GeIpKillConnection | ( | IpConnection * | ipc | ) |
Kills an IP connection.
[in] | ipc | The IP connection to kill. The caller owns the pointed IpConnection. |
Int32 cineware::GeIpBytesInInputBuffer | ( | IpConnection * | ipc | ) |
Checks how many bytes are in the input buffer of a IP connection.
[in] | ipc | The IP connection to check. The caller owns the pointed IpConnection. |
Int cineware::GeIpReadBytes | ( | IpConnection * | ipc, |
void * | buf, | ||
Int | size | ||
) |
Reads bytes from an IP connection.
[in] | ipc | The IP connection to read from. The caller owns the pointed IpConnection. |
[in] | buf | The buffer to read to. The caller owns the pointed buffer. |
[in] | size | The size of the buffer. |
Int cineware::GeIpSendBytes | ( | IpConnection * | ipc, |
void * | buf, | ||
Int | size | ||
) |
Sends bytes to a IP connection.
[in] | ipc | The IP connection to send to. The caller owns the pointed IpConnection. |
[in] | buf | The buffer to send from. The caller owns the pointed buffer. |
[in] | size | The size of the buffer. |
void cineware::GeIpGetHostAddr | ( | IpConnection * | ipc, |
Char * | buf, | ||
Int32 | bufsize | ||
) |
Gets the host address of a IP connection.
[in] | ipc | The IP connection. The caller owns the pointed IpConnection. |
[in] | buf | The buffer to take the host address. The caller owns the pointed buffer. |
[in] | bufsize | The size of the buffer. |
void cineware::GeIpGetRemoteAddr | ( | IpConnection * | ipc, |
Char * | buf, | ||
Int32 | bufsize | ||
) |
Gets the remote address of a IP connection.
[in] | ipc | The IP connection. The caller owns the pointed IpConnection. |
[in] | buf | The buffer to take the remote address.The caller owns the pointed buffer. |
[in] | bufsize | The size of the buffer. |
Random sleep timer.
[in] | min | The minimum time in milliseconds. |
[in] | max | The maximum time in milliseconds. |
String cineware::GetTimeString | ( | ) |
Unused.