Home Forums Support Problem with UDP broadcast

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #4003
    Anonymous
    Inactive

    Hey ,

    Im trying to do a broadcast using simple plain UDP. My server is started on localmachine with standard class C ip address (i.e. 192.168.1.X)

    I’m getting :

    
    An unhandled exception of type 'System.Net.Sockets.SocketException' occurred in System.dll
    
    Additional information: The requested address is not valid in its context
    

    When I try to execute the folowing code :

    
                SendReceiveOptions optionsToUseForUDPOutput = new SendReceiveOptions<NullSerializer>();
    
                
    
                using (Packet sendPacket = new Packet("Unmanaged", Encoding.ASCII.GetBytes("pwd"), optionsToUseForUDPOutput))
                {
                    UDPConnection.SendObject<byte[]>(sendPacket, new IPEndPoint(IPAddress.Broadcast, 48899), optionsToUseForUDPOutput, ApplicationLayerProtocolStatus.Disabled);
    
                }
    
    #4010
    Anonymous
    Inactive

    I’m not entirely sure why you are getting the error, it should work. Could you please try using the broadcast address “0.0.0.0” and see if it works or you get the same/different error?

    Kind regards,
    Marc

    #4015
    Anonymous
    Inactive

    Hey ,

    When I have changed the address this is what I get (I’m using 3.0.3)

    `
    An unhandled exception of type ‘NetworkCommsDotNet.ConnectionSetupException’ occurred in NetworkCommsDotNetComplete.dll

    Additional information: Attempting to determine the best local endPoint to connect to 0.0.0.0:48899 resulted in a socket exception.

    • This reply was modified 6 years, 6 months ago by . Reason: version added
    #4025
    Anonymous
    Inactive

    It sounds like one of your network adaptors is causing a problem. I would recommend disabling all adaptors, enable one at a time and then see if you still get the error. If this fixes the problem you can restrict NetworkComms.Net to only use specific adaptors using https://networkcomms.net/api/html/P_NetworkCommsDotNet_Tools_HostInfo_RestrictLocalAdaptorNames.htm

    Let me know how it goes.

    #4047
    Anonymous
    Inactive

    Hey ,

    I narrowed down the problem. Within my default interface problem (as that was only one I left enabled) I discovered that Virtual box is giving me this error.

    While I unchecked it – the problem dissapeared. Now my question is : “Have you guys had problems with VirtualBox driver on Windows machines ?”

    Thanks
    Rafal

    #4048
    Anonymous
    Inactive

    Heya Rafal,

    Thanks for the update. Yes we have had issues with some virtual adaptors in the past. We have not been able to think of a solution that will work for everyone so far, if you have any suggestions, please let us know.

    Regards,
    Marc

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.