-
首页
-
C4D R23.110 C++ SDK
NetworkIpHandlerInterface Class Reference
#include <network_webserver.h>
详细描述
Interface to access more high level functions to read/send from NetworkConnectionRef. This functions are used by the web server to read and send data.
成员函数文档编制
◆
MAXON_INTERFACE()
◆
InitConnection()
MAXON_METHOD
Result
<void> InitConnection
|
(
|
const NetworkConnectionRef &
|
connection
,
|
|
|
const NetworkWebServerRef &
|
webServer
|
|
)
|
|
|
Initializes the object with a NetworkConnectionRef. This might be an incoming or outgoing connection.
-
参数
-
[in]
|
connection
|
NetworkConnectionRef for low level ip access.
|
[in]
|
webServer
|
Optional parameter to a NetworkWebServerRef.
|
-
返回
-
True if the functions was successful.
◆
GetConnection()
Returns the NetworkConnectionRef connected to this object.
◆
GetWebServer()
Returns the NetworkWebServerRef connected to this object. It may return nullptr if no server is set in this connection.
◆
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 the data to be received.
|
-
返回
-
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 the data to be received.
|
-
返回
-
Returns the number of bytes read or the error.
◆
ReadLine()
Reads data up to the next return character in the stream.
-
参数
-
[out]
|
str
|
Reference to a string which receives the data.
|
-
返回
-
True if the functions was successful.
◆
SendBytes()
Sends data to the connection. Please note that you need to call
FlushWriteBuffer()
before the data goes out. The functions tries to cache as much as possible before sending each bit separately.
-
参数
-
[in]
|
buffer
|
Block
with the data to send.
|
-
返回
-
True if the functions was successful.
◆
SendString()
[1/2]
Sends a
String
. Please note that you need to call
FlushWriteBuffer()
before the data goes out. The functions tries to cache as much as possible before sending each bit separately.
-
参数
-
[in]
|
str
|
数据
string to be send.
|
[in]
|
encoding
|
String
encoding that should be used to convert into 8-bit chars.
|
[in]
|
size
|
-1 for the complete string. Otherwise the string is sent only with a shortened length.
|
-
返回
-
True if the functions was successful.
◆
SendString()
[2/2]
Sends a
CString
. Please note that you need to call
FlushWriteBuffer()
before the data goes out. The functions tries to cache as much as possible before sending each bit separately.
-
参数
-
[in]
|
str
|
数据
string to be send.
|
[in]
|
size
|
-1 for the complete string. Otherwise the string is sent only with a shortened length.
|
-
返回
-
True if the functions was successful.
◆
FlushWriteBuffer()
Flushes the write cache and forces the data to be send out.
-
返回
-
True if the functions was successful.