Skip to content

Commit

Permalink
feat(SocketLayer): adding FlushBatch to Connection
Browse files Browse the repository at this point in the history
will send next batch to socket when called
  • Loading branch information
James-Frowen committed May 26, 2022
1 parent 2a03d2a commit 476156a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions Assets/Mirage/Runtime/SocketLayer/Connection.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,14 @@ public interface IConnection
void SendUnreliable(byte[] packet);
void SendUnreliable(byte[] packet, int offset, int length);
void SendUnreliable(ArraySegment<byte> packet);

/// <summary>
/// Forces the connection to send any batched message immediately to the socket
/// <para>
/// Note: this will only send the packet to the socket. Some sockets may not send on main thread so might not send immediately
/// </para>
/// </summary>
void FlushBatch();
}

/// <summary>
Expand Down Expand Up @@ -432,6 +440,11 @@ void UpdateDisconnected()
}
}

void IConnection.FlushBatch()
{
this.ackSystem.Update();
}

/// <summary>
/// Used to keep connection alive
/// </summary>
Expand Down

0 comments on commit 476156a

Please sign in to comment.