mirror of
https://github.com/Sanae6/SmoOnlineServer.git
synced 2024-11-21 18:55:17 +00:00
Set send buffer to 1
This commit is contained in:
parent
a288e5b7a8
commit
206bbd5d4c
2 changed files with 4 additions and 2 deletions
|
@ -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();
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue