From 20519905e2c26aba9f3d6fd6033369c0dfb974af Mon Sep 17 00:00:00 2001 From: sebastian-heinz Date: Fri, 7 Feb 2020 05:49:05 +0800 Subject: [PATCH] fix udp bug --- Arrowgene.Services/Networking/Udp/UdpSocket.cs | 10 +++++++--- services.version | 2 +- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Arrowgene.Services/Networking/Udp/UdpSocket.cs b/Arrowgene.Services/Networking/Udp/UdpSocket.cs index dd9a3c3..fe7f90f 100644 --- a/Arrowgene.Services/Networking/Udp/UdpSocket.cs +++ b/Arrowgene.Services/Networking/Udp/UdpSocket.cs @@ -57,15 +57,19 @@ public class UdpSocket /// /// Creates a new instance of /// - public UdpSocket() + public UdpSocket() : this (DefaultMaxPayloadSizeBytes) { + } + + public UdpSocket(int maxPayloadSizeBytes) + { + MaxPayloadSizeBytes = maxPayloadSizeBytes; _isBound = false; _receive = false; _buffer = new byte[MaxPayloadSizeBytes]; _socket = new Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp); - MaxPayloadSizeBytes = DefaultMaxPayloadSizeBytes; } - + /// /// Occurs when data is received /// diff --git a/services.version b/services.version index d9ee657..11d0d97 100644 --- a/services.version +++ b/services.version @@ -1 +1 @@ -1.13.3 \ No newline at end of file +1.13.4 \ No newline at end of file