[Gambas-user] not able to send UDP datagram on local host

pflora at libero.it pflora at libero.it
Thu Sep 3 22:15:02 CEST 2020


Following your advice I got the UDPSocket sending data.
Strange thing is that I was testing the output with the command

sudo tcpdump -X port 50010

and nothing was on the screen.
Then I put a node-red UDP listener and I receive the data but still no output from tcpdump.

With 2 applications written in C sending to ports 50000 and 50001 I can trace UDP packets with tcpdump but not the ones sent with gambas on port 50010.
I was tricked by this strange behaviour.

> Il 02/09/2020 23:09 Benoît Minisini <g4mba5 at gmail.com> ha scritto:
> 
>  
> Le 02/09/2020 à 20:43, pinglix via User a écrit :
> > Hello,
> > 
> > I am new to gambas and I am tring to send datagrams on port 50010 on 
> > localhost.
> > 
> > In a form I put 2 UDPSocket listeners on port 50000 and 50001 and they 
> > work fine, they capture packets coming from 2 applications sending data 
> > on such ports.
> > 
> > Then I put a third UDPSocket to send data on port 50010 to the above 
> > applications but I cannot get this working.
> > 
> > I tried to configure the socket but nothing is coming out. I cannot find 
> > a way to send the data.
> > 
> > TargetHost should be local host 127.0.0.1 and TargetPort 50010
> > 
> > I am very frustated after some days of testing, in C language it was 
> > very easy to do this.
> > 
> > I attach my simple project.
> > 
> > Any help is appreciated.
> > 
> > Thanks
> > 
> 
> I just set the TargetPort property of UdpCmd to 50000, and everything 
> works as expected (I see "Test-1" in the left textarea).
> 
> If you don't set the Broadcast property, then you have to set the 
> TargetHost to 127.0.0.1.
> 
> Regards,
> 
> -- 
> Benoît Minisini
> 
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----


More information about the User mailing list