Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions com.unity.multiplayer.transport.utp/Runtime/UTPTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,23 @@ private IEnumerator StartRelayServer(SocketTask task)
#endif
}

private bool AcceptConnection()
{
var connection = m_Driver.Accept();

if (connection != default(NetworkConnection))
{
InvokeOnTransportEvent(NetworkEvent.Connect,
ParseClientId(connection),
NetworkChannel.Internal,
default(ArraySegment<byte>),
Time.realtimeSinceStartup);
return true;
}

return false;
}

private bool ProcessEvent()
{
var eventType = m_Driver.PopEvent(out var networkConnection, out var reader);
Expand Down Expand Up @@ -344,6 +361,7 @@ private void Update()
if (m_Driver.IsCreated)
{
m_Driver.ScheduleUpdate().Complete();
while(AcceptConnection() && m_Driver.IsCreated);
while(ProcessEvent() && m_Driver.IsCreated);
}

Expand Down