2
0
mirror of https://github.com/esiur/esiur-dotnet.git synced 2025-12-14 00:40:26 +00:00

Deserialization fix

This commit is contained in:
2025-11-16 11:06:20 +03:00
parent e2e4ac90bc
commit d730fe1b8d
14 changed files with 571 additions and 221 deletions

View File

@@ -45,6 +45,12 @@ public class TCPSocket : ISocket
bool held;
public Socket Socket => sock;
int bytesSent, bytesReceived;
public int BytesSent => bytesSent;
public int BytesReceived => bytesReceived;
//ArraySegment<byte> receiveBufferSegment;
NetworkBuffer receiveNetworkBuffer = new NetworkBuffer();
@@ -117,6 +123,7 @@ public class TCPSocket : ISocket
if (recCount > 0)
{
socket.bytesReceived += recCount;
socket.receiveNetworkBuffer.Write(socket.receiveBuffer, 0, (uint)recCount);
socket.Receiver?.NetworkReceive(socket, socket.receiveNetworkBuffer);
@@ -287,6 +294,8 @@ public class TCPSocket : ISocket
if (state == SocketState.Closed)// || state == SocketState.Terminated)
return;
bytesSent += size;
var msg = message.Clip((uint)offset, (uint)size);
lock (sendLock)