Xojo Cloud UDPSocket Write/Read In Progress to be solved. Slow Me down !

Hi Dear friends

New in Xojo, but not newbie at programming level, I encounter this nasty problem:

Dim f As New XojoCloud.FirewallPort(kPort, XojoCloud.FirewallPort.Direction.Outgoing)
f.Open

Dim udpSend As New UDPSocket

udpSend.Port = kPort // (49243)

if f.isOpen Then
udpSend.Connect
if udpSend.IsConnected Then

Label7.Text = "Udp: " + Str(udpSend.IsConnected) // True !!!
udpSend.Write(addTextField.Text, msgTextField.Text) // Got Udp Connected False and Error Code 107 and the Port It's still Open!!

// Label6.Text = "UDP Example - Port: " + Str(udpSend.Port) + " Last Error Code : " + Str(udpSend.LastErrorCode)
//Label6.Text = Label6.Text + " Udp: " + Str(udpSend.IsConnected) + " Port: " + Str(f.IsOpen)
End If
udpSend.Close
f.Close
End If

What I’m doing wrong ? At local level, everything working well and smouth, but same Code on Xojo Cloud NOT !
At Xojo Cloud the UDPSocket don’t working ? What happening ?

If you have some suggestions to solve this issue, pls. inform’me.

All my data loggers using Cat M1 can send/receive data from/to Socket Test/Udp Test Tool !

Have somebody tested this kind of communication ???

Thanks
Zoltan

i Should to check QT ? Your solution struggle/not working with UDP Packages. I should to apply to “Total Refound Police ?”
Be carefull next buyers about this unsolved issue from this guys.

Sigh…

Don’t be so dramatic. Wait until the rest of the world is awake.

Hi Zoltan,
please check the Port property after calling the Connect method and proceed as required.
Report here your results and possibly we can help you.

Be aware that most Xojo’s objects are event driven and it’s better if you refactor your code in an event driven way.

P.S.
Also QT is event driven so switching to it change nothing.

Hi Maurizio Rossi

It’s one nice good sounding name. Thank you for your very fast feedback !
Please check my first mail. Everything its ok with first udpsocket opening. The issue are came invocing the udp write command . Got udp closed and 107 error code !
I spended to much time to discover this Xojo error, I’m ready to give it up …

Zoltan

to Beatrix Willius

Who are You to give to me advice ?

Do You have some UDP At Cloud Level advises Yes or Not !

Maurizio is correct. UDPSocket is not a synchronous protocol and you are trying to treat it as such. Looking at this code:

Label7.Text = "Udp: " + Str(udpSend.IsConnected) // True !!! udpSend.Write(addTextField.Text, msgTextField.Text) // Got Udp Connected False and Error Code 107 and the Port It's still Open!!
Based on your comments, I think there are two possibilities (although I really think it’s #1)
0. You probably need to also open an incoming firewall port
0. The port may be in use by another system resource. Remember, just because it’s your own server, doesn’t mean that there aren’t other services using system resources.

[quote=456777:@Zoltan Magdo]to Beatrix Willius

Who are You to give to me advice ?

Do You have some UDP At Cloud Level advises Yes or Not ![/quote]
This is a user forum and you will always get answers from other users, some who are using Xojo Cloud and some who are not… and maybe from Xojo, if we happen to notice your thread. Please be civil.

Hi Greg

Yes, I have one One opened Firewall Port as you can see at my original post the port was open and udpsocket also was alive. After using UDPSocket Write command, I got 107 error code message and the udp connection was going to False !

Please, If You have time and kind, try my original code and maybe can you find find something what I made wrong ! I can pay for this services !

Zoltan

You mean, Maurizio.

I’ll make some coffee. :smiley:

I think Greg pinched my popcorn :frowning:

[quote=456792:@Zoltan Magdo]Hi Greg

Yes, I have one One opened Firewall Port as you can see at my original post the port was open and udpsocket also was alive. After using UDPSocket Write command, I got 107 error code message and the udp connection was going to False !

Please, If You have time and kind, try my original code and maybe can you find find something what I made wrong ! I can pay for this services !

Zoltan[/quote]
You didn’t read my response. Your code indicates that you only created an Outgoing port. UDP being a broadcast protocol may also require an incoming port to function properly. Please try that.

Hi Greg

Thanks. Getting Old ! Need to create Incoming/Outgoing FirewallPort separately for same Port ?
It’s late night at Auckland. I will try tomorrow morning and i will get back to you Sir !
Thanks !

see also this guide
UserGuide:UDP_Communication

(i think the SocketCore methods in udp class is a little bit misleading.)

Hi
Thanks. As I say previously, on local machines this working very well but when we try to use from Xojo Cloud same code, having FirewallPort opened for Incoming/Outgoing traffic , we always have 107 Error Code back when we try to send message !

Thanks Markus to be kind and try to help !

We have one large gps agriculture asset tracking solution to finish soon. We have everything from the data logger side and of course we tested with some SocketTest/Udp Test Tool/etcetera and everything working well and nice ! We are blocked at server side wit Xojo ! No UDP communication and we are middle of nowhere !

Thanks

Hi Markus

Yes, indeed ! As you say before (i think the SocketCore methods in udp class is a little bit misleading.) !

Q. This issue can be solved soon ? … before I lost my Xojo PayBack possibility ? I dont like to pay for not working things…

Zoltan

Yes, just like everywhere else. Firewalls on desktop computers are usually always open for outgoing and selectively open for incoming data. [quote=456817:@Zoltan Magdo]Q. This issue can be solved soon ? … before I lost my Xojo PayBack possibility ? I dont like to pay for not working things…[/quote]
As far as I know, there is nothing “not working” with UDP in Xojo or Xojo Cloud. We just need to figure out why you are having trouble.

I do understand Zoltan’s doubts, because in some systems you give/revoke firewall permissions for ports like: incoming, outgoing, or both.
Not having “both” at once seems kind of weird if this is how he is used to.

Hi Dear friends

I checked everything on my side … and still the 107 Error Code problem persist !

If someone have time and mood please try the following link : http://159.89.85.59/UDP_1-Dev/
This is for testing purposes Cloud address, so, nothing restricted…

I followed Greg’s advice’s, but as you can see if you try (http://159.89.85.59/UDP_1-Dev/) Xojo feedback is “The Port is open for incoming/Outgoing communication” but the write command still not working, closing the UDPSocket and feedback 107 Error Code !

Thanks
Zoltan