Set send buffer to 1

This commit is contained in:
Sanae 2022-03-15 17:23:53 -06:00
parent a288e5b7a8
commit 206bbd5d4c
2 changed files with 4 additions and 2 deletions

View File

@ -18,6 +18,7 @@ public class Server {
public async Task Listen(CancellationToken? token = null) {
Socket serverSocket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);
serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, true);
serverSocket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.SendBuffer, 1);
serverSocket.Bind(new IPEndPoint(IPAddress.Parse(Settings.Instance.Server.Address), Settings.Instance.Server.Port));
serverSocket.Listen();

View File

@ -71,7 +71,8 @@ async Task S(string n, Guid otherId, Guid ownId) {
if (header.Id != otherId) continue;
if (reboundPackets.All(x => x != type)) continue;
if (type == PacketType.Player) {
PlayerPacket packet = new PlayerPacket();
packet.
}
header.Id = ownId;
MemoryMarshal.Write(owner.Memory.Span[..Constants.HeaderSize], ref header);
@ -81,7 +82,7 @@ async Task S(string n, Guid otherId, Guid ownId) {
}
Guid temp = baseOtherId;
IEnumerable<Task> stuff = Enumerable.Range(0, 7).Select(i => {
IEnumerable<Task> stuff = Enumerable.Range(0, 1).Select(i => {
Guid newOwnId = Guid.NewGuid();
Task task = S($"Sussy {i}", temp, newOwnId);
temp = newOwnId;