Home Forums Support Simple Broadcast and Receive of Raw Bytes using UDP Reply To: Simple Broadcast and Receive of Raw Bytes using UDP

#2717
Anonymous
Inactive

Heya Don,

I’ve tried to condense the test case down further to ensure it was easily repeatable.

I ended up with the following, but this actually appears to work successfully (i.e. no unhandled exceptions):

public static void RunTest()
{
    SendReceiveOptions optionsToUseForUDPOutput = new SendReceiveOptions<NullSerializer>();
    SendReceiveOptions optionsToUseForUDPInput = new SendReceiveOptions<NullSerializer>();

    UDPConnectionListener udpListener = new UDPConnectionListener(optionsToUseForUDPInput, ApplicationLayerProtocolStatus.Disabled, UDPOptions.None);

    //Add a packet handler for dealing with incoming unmanaged data
    udpListener.AppendIncomingUnmanagedPacketHandler(HandleIncomingUDPPacket);

    Connection.StartListening(udpListener, new IPEndPoint(IPAddress.Any, 10000));

    //Stop listening and attempt to use the same port again
    Connection.StopListening(udpListener);
    Connection.StartListening(udpListener, new IPEndPoint(IPAddress.Any, 10000));

    //Stop listening and attempt to use a different port 
    Connection.StopListening(udpListener);
    Connection.StartListening(udpListener, new IPEndPoint(IPAddress.Any, 20000));
}

I used version 3.0.1 of the library for the above. Could you possibly run this and see what you get?

Regards,
Marc