#include <network_ip.h>
This class offers basic network connection functions to read/send data and manage connections.
Classes | |
class | Properties |
Private Member Functions | |
MAXON_INTERFACE (NetworkConnectionInterface, MAXON_REFERENCE_NORMAL, "net.maxon.interface.networkconnection") | |
|
private |
MAXON_METHOD Result<void> CloseConnection | ( | ) |
Closes a connection by closing the socket.
MAXON_METHOD Result<void> KillConnection | ( | ) |
Killing a connection and canceling the connected threads.
MAXON_METHOD Result<Int> BytesInInputBuffer | ( | ) |
Returns the number of bytes that is available in the receive buffer.
MAXON_METHOD Result<void> RecvBytes | ( | const Block< Byte > & | data | ) |
Reads the requested number of bytes from the connection. The function will not return before the number of requested bytes has been read or an error occurred.
[in] | data | Block for data buffer with requested number of bytes to read. |
MAXON_METHOD Result<Int> RecvBytesEOS | ( | const Block< Byte > & | data | ) |
Reads the requested number of bytes from the connection to the end of the stream. The function will not return before the number of requested bytes has been read, an error occurred or the stream has been closed.
[in] | data | Block for data buffer with requested number of bytes to read. |
MAXON_METHOD Result<void> SendBytes | ( | const Block< const Byte > & | buffer | ) |
Sends the given number of bytes to the connection. The function will not return before the number of given bytes is sent or an error occurred. Full duplex connections will not flush the send buffer until FlushWriteBuffer() is called.
[in] | buffer | Block with the data to send. |
MAXON_METHOD Result<void> FlushWriteBuffer | ( | ) |
Flushes the write buffer and send the collected bytes to the network connection.
MAXON_METHOD Result<void> ResetBuffers | ( | ) |
Empties the read and write buffer for the next connection. This can be useful if the connection is of type keep alive.
MAXON_METHOD Int64 GetTransferedBytes | ( | ) | const |
Returns the number of transfered bytes. -1 if an error occurred.
MAXON_METHOD NetworkIpAddrPort GetRemoteAddr | ( | ) | const |
Returns the remote address of this connection.
MAXON_METHOD NetworkIpAddrPort GetHostAddr | ( | ) | const |
Returns the host address of this connection.
MAXON_METHOD SOCKET GetSocket | ( | ) | const |
MAXON_METHOD Result<void> SetNonBlockingSocket | ( | Bool | nonBlockingSocket | ) |
TODO: (Seb) Comment.
MAXON_METHOD Bool IsNonBlockingSocket | ( | ) | const |
TODO: (Seb) Comment.
MAXON_METHOD Result<void> SetUseNagleAlgorithm | ( | Bool | useNagleAlgorithm | ) |
TODO: (Seb) Comment.
MAXON_METHOD Bool GetUseNagleAlgorithm | ( | ) | const |
TODO: (Seb) Comment.
MAXON_METHOD Result<void> SetTimeout | ( | TimeValue | timeoutInSeconds | ) |
TODO: (Seb) Comment.
MAXON_METHOD TimeValue GetTimeout | ( | ) | const |
TODO: (Seb) Comment.
MAXON_METHOD CONNECTIONTYPE GetConnectionType | ( | ) | const |
TODO: (Seb) Comment.
MAXON_METHOD void SetConnectionType | ( | CONNECTIONTYPE | type | ) |
TODO: (Seb) Comment.
MAXON_METHOD void SetThread | ( | const ThreadRef & | ref | ) |
TODO: (Seb) Comment.
The current thread will always be checked for cancellation. You only have to set a thread if an additional thread should be checked for cancellation, too.
[in] | ref | An optional thread which will be checked for cancellation. |
MAXON_METHOD String GetProxyServerInfo | ( | ) | const |
Returns the stored proxy server information the was set using SetProxyInfo(). The format of the string is "<<server>>:<<port>>".
MAXON_METHOD void SetProxyServerInfo | ( | const String & | proxyInfo | ) |
Sets the proxy server to for later use of GetProxyInfo().
[in] | proxyInfo | Info to set. The format of the proxyInfo must be "<<server>>:<<port>>". |