UE网络-相关配置

网络相关配置

UNetDriver.InitialConnectTimeout

1
2
3
/** Amount of time to wait for a new net connection to be established before destroying the connection */
// 建立连接的超时时间
float InitialConnectTimeout;

UNetDriver.ConnectionTimeout

1
2
3
4
5
6
7
/** 
* Amount of time to wait before considering an established connection timed out.
* Typically shorter than the time to wait on a new connection because this connection
* should already have been setup and any interruption should be trapped quicker.
*/
// 连接的超时时间
float ConnectionTimeout;

在函数UNetConnection::GetTimeoutValue()中使用. 在函数UNetConnection.Tick()中, 每帧检测上一次收包到现在的间隔时间是否超时.

image-20240322165651177
image-20240322165756787

配置: 600秒超时

image-20240322170031973