-
首页
-
C4D R23.110 C++ SDK
NetworkConnectionInterface Class Reference
#include <network_ip.h>
详细描述
This class offers basic network connection functions to read/send data and manage connections.
成员函数文档编制
◆
MAXON_INTERFACE()
◆
CloseConnection()
Closes a connection by closing the socket.
-
返回
-
OK on success.
◆
KillConnection()
Killing a connection and canceling the connected threads.
◆
BytesInInputBuffer()
Returns the number of bytes that is available in the receive buffer.
-
返回
-
Number of bytes available in the read stream. A value of -1 if an error occurred.
◆
RecvBytes()
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.
|
-
返回
-
OK on success.
◆
RecvBytesEOS()
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.
|
-
返回
-
Returns the number of bytes read or the error.
◆
SendBytes()
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.
|
-
返回
-
OK on success.
◆
FlushWriteBuffer()
Flushes the write buffer and send the collected bytes to the network connection.
-
返回
-
OK on success.
◆
ResetBuffers()
Empties the read and write buffer for the next connection. This can be useful if the connection is of type keep alive.
-
返回
-
OK on success.
◆
GetTransferedBytes()
Returns the number of transfered bytes. -1 if an error occurred.
◆
GetRemoteAddr()
Returns the remote address of this connection.
◆
GetHostAddr()
Returns the host address of this connection.
◆
GetSocket()
◆
SetNonBlockingSocket()
TODO: (Seb) Comment.
◆
IsNonBlockingSocket()
TODO: (Seb) Comment.
◆
SetUseNagleAlgorithm()
TODO: (Seb) Comment.
◆
GetUseNagleAlgorithm()
TODO: (Seb) Comment.
◆
SetTimeout()
TODO: (Seb) Comment.
◆
GetTimeout()
TODO: (Seb) Comment.
◆
GetConnectionType()
TODO: (Seb) Comment.
◆
SetConnectionType()
TODO: (Seb) Comment.
◆
SetThread()
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.
|
◆
GetProxyServerInfo()
Returns the stored proxy server information the was set using SetProxyInfo(). The format of the string is "<<server>>:<<port>>".
◆
SetProxyServerInfo()
Sets the proxy server to for later use of GetProxyInfo().
-
参数
-
[in]
|
proxyInfo
|
Info to set. The format of the proxyInfo must be "<<server>>:<<port>>".
|