1
This commit is contained in:
@@ -16,8 +16,11 @@ namespace BITKit.Net.Kcp
|
||||
[SerializeField] private ushort m_port;
|
||||
[SerializeField] private bool connectOnStart;
|
||||
[SerializeField] private bool autoReconnect;
|
||||
|
||||
[Header(Constant.Header.Debug)]
|
||||
[SerializeField]
|
||||
[ReadOnly] private int id;
|
||||
[SerializeField]
|
||||
[ReadOnly]private Vector2 traffic;
|
||||
[SerializeField]
|
||||
[ReadOnly]private string upTraffic;
|
||||
@@ -36,7 +39,7 @@ namespace BITKit.Net.Kcp
|
||||
private INetClient _netClientImplementation=>client;
|
||||
private INetProvider _netProviderImplementation=>client;
|
||||
|
||||
private readonly IntervalUpdate _reconnectInterval = new(1);
|
||||
private readonly IntervalUpdate _reconnectInterval = new(3);
|
||||
|
||||
public event Action OnStartConnect
|
||||
{
|
||||
@@ -212,9 +215,14 @@ namespace BITKit.Net.Kcp
|
||||
if (client.IsConnected is false && autoReconnect)
|
||||
{
|
||||
if (_reconnectInterval.AllowUpdate)
|
||||
client.Connect(m_host, m_port).Forget();
|
||||
{
|
||||
if (client.IsConnecting is false)
|
||||
{
|
||||
client.Connect(m_host, m_port).Forget();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
id = Id;
|
||||
timer.Update(obj);
|
||||
rate = timer;
|
||||
Tick();
|
||||
|
Reference in New Issue
Block a user