markiodev / Networker

A simple to use TCP and UDP networking library for .NET. Compatible with Unity.
MIT License
477 stars 77 forks source link

SendUdp not work #45

Closed iamkisly closed 5 years ago

iamkisly commented 5 years ago

https://github.com/MarkioE/Networker/blob/cd73d2ad78a19a341ede0579e1af858a61daff23/Networker/Server/ServerPacketProcessor.cs#L48

The use of Udp is possible only at the reception, since at this moment _socketSender is null and cannot be specified yet. Since SetUdpSender is never called, sending Udp packets is not possible.

markiodev commented 5 years ago

Fixed in 3.0.4

iamkisly commented 5 years ago

I looked at the contents of version 3.0.5 and how you fixed it says that the code was not even checked in action.

https://github.com/MarkioE/Networker/blob/c52321bc5f7331745e63479c4b26c88e6c6049fd/Networker/Server/ServerBuilder.cs#L47

At this point, the pool has already been allocated! And calling SetUdpSender is useless. You had to add IUdpSocketSender to the constructor, and call SetUdpSender before udpSenderObjectPool was filled.