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

  1. ‹ Older
  2. last week

    Greg O

    Oct 8 Xojo Inc

    @Rick A 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.

    But if he's done what I asked him to in my first response, both of those ports will be open now.

    I'm looking at the server now to see if we can figure out what's going on.

  3. Greg O

    Oct 8 Xojo Inc
    Edited last week

    Ok, so looking at your updated code on the URL you provided, I see some immediate problems.

    1. As was mentioned at the top of this thread, UDPSocket is not a synchronous protocol, and you're still trying to make it be. I understand that all of this code works locally on your own machine, but the reality is that on your local network, network activity is _really fast_ lending to the fact that it's all "right there". A server, no matter how far away is going to introduce some latency. If your server is in Amsterdam or New York and you are in New Zealand, there's going to be a little bit of a delay between send and response.
    2. The next problem I see is that you are declaring the firewall ports as local variables. The way Xojo Cloud works is that those ports will only stay open as long as those variables exist. When the variables go out of scope, the firewall ports are automatically closed. If you make them properties on the App class, they'll stay open for as long as your app is running. It would probably be prudent to move those firewall constructors to the App.Open event as well.
    3. UDPSocket should also not be declared as a local variable. It needs to exist beyond the scope of the method to be able to continue sending/receiving after the method closes.
    4. I see you've set RouterHops to 255. So.... I seriously doubt that this needs to be this high and you may be actually hurting the performance of UDPSocket in doing so.
    5. You have a line that says If fOut.IsOpen Then. While I agree that this looks correct, opening firewall ports is not synchronous. That is, when you request a firewall port be opened (yes, request, and it can be denied for a number of reasons), the request is sent to the Xojo Cloud infrastructure which will make those changes some time in the next few seconds. It's usually less than one, but if the system is really busy, it may take a little bit of time.

    Ok, so after all that, I clicked the "Send" button, and found that the port is indeed closing before the packet gets sent. Making those firewall entries manually, I got the following output:

    Opening the : 49243 for Incoming and Outgoing data --->
    
    Port : (49243)  Port In Opened : True / Port Out Opened : True
    
    RouterHops: 255
    
    UDPSocket is connected : True
    
    Try to send some data with the write command--->
    
    LastErrorCode for the write command: 0
    
    PacketsLeftToSend : 0
    
    After the write command: Port : 49243--> Port In Opened : True / Port Out Opened : True
    
    After the write command UDPSocket is connected : True

    Please make the changes that I suggested in #2 and #3 above and lets see if that helps your situation.

  4. Julian S

    Oct 8 Pre-Release Testers, Xojo Pro UK

    @Greg OLone While I agree that this looks correct, opening firewall ports is not synchronous.

    FirewallPort.Open
    Attempts to open the firewall port. This call is synchronous and may take a few seconds.

    Is the doc wrong then?

  5. Greg O

    Oct 8 Xojo Inc

    @Julian S FirewallPort.Open
    Attempts to open the firewall port. This call is synchronous and may take a few seconds.

    Is the doc wrong then?

    I believe so. Regardless, they’re not staying open.

  6. Julian S

    Oct 8 Pre-Release Testers, Xojo Pro UK

    Ok, I just spent about an hour working on it and I can't get xojo cloud to write to a udp connection.

    Everything I tried ends up with an error coming back as 107. I stripped out everything so it wasnt running synchronously and error 107 was always coming back in the error event after the write.

    Connect worked, the port value responded with the correct port value after the connect but the write always came back with 107.

    Nothing that was recommended above made any difference.

  7. Hi Julian Samphire

    Your help it's very appreciated !

    Zoltan

  8. Greg O

    Oct 9 Xojo Inc

    @Julian S Ok, I just spent about an hour working on it and I can't get xojo cloud to write to a udp connection.

    Everything I tried ends up with an error coming back as 107. I stripped out everything so it wasnt running synchronously and error 107 was always coming back in the error event after the write.

    Connect worked, the port value responded with the correct port value after the connect but the write always came back with 107.

    Nothing that was recommended above made any difference.

    Which is completely bizarre because when I manually but temporarily inserted the firewall entries that match what the FirewallPort command makes, that test app gave a lastErrorCode if zero. I think that’s where we need to focus to get this working properly.

  9. Edited last week

    Thanks Greg,

    Sorry if I'm too pushing person, but You know, we are tech persons and we have responsibility to give good solutions to our clients fast as possible...

    Yes, indeed, the time difference make our conversations difficult, but You Sir have to know, I'm talking with many people around of word and I had no communication issues between friends until now.

    Zoltan

    Ps.
    11:54:09 p.m. NZDT
    Wednesday, 9 October 2019

    Tomorrow morning I will try to send my/Julian Xojo Linux compilation to my cPanel cgi folder. I want to be sure, if this problem persist at cgi-bin level also...

  10. Greg O

    Oct 9 Xojo Inc

    @Zoltan M Yes, indeed, the time difference make our conversations difficult, but You Sir have to know,.

    The most difficult part is that I have been on holiday for the last week. As such I’m not as available as I might otherwise be and the other Xojo tech that works on this stuff is three hours behind me.

    I'm talking with many people around of word and I had no communication issues until now

    I don’t doubt that and I am trying to help. To be fair, this is the first time that I recall having problems with UDP on Xojo Cloud since we started. it may just be that you are the first to try it, or it may be unique to your situation. That’s what I’m trying to solve for you.

    Is that test project something that I can download and test with?

  11. Edited last week

    Hi Greg

    We can use Dropbox if you like, but I will need one valid email address to share it to You.
    I can send toYou Sir, the latest Code from Julian....

    Zoltan

    Sorry for disturbing, from Auckland I can't see if you are available.... The forum is like the UDP communication, someone send a message and if he/she is lucky, get some answers...

  12. Julian S

    Oct 9 Pre-Release Testers, Xojo Pro UK

    Zoltan, if you click the share button on the zip and click Create link, then Copy link, you'll get access to a link that you can paste into the forum for Greg to download the zip.

  13. Greg O

    Oct 9 Xojo Inc

    @Zoltan M Hi Greg

    Better idea, I just made one Skype account. magdoz1959 or magdoz59@gmail.com / Zoltan Magdo

    Pls. contact me and I send the code . Thanks...

    Zoltan

    As I said, I’m on holiday. You can start a private conversation with me here on the forum by clicking on my name and then click “start a private conversation “. If you would kindly put a download link in there, One of us will look at it today.

  14. 5 days ago
  15. Edited 5 days ago

    Hi Greg,

    Just Joking... and nothing more...

    Sir, You have to rise up one red flag (like the bondi surfer guys what I saw...) when you're busy/Holiday ... and we humble Xojo people/users will not try to disturbing you Sir... We are humans ...
    On the international company level we use one kind of mass email sending app. with "I'm out from my office until xxxxxx date' message... and it's not polite by business partners to call me, only on emergency reasons !

    Zoltan

  16. Edited 5 days ago

    Hi Rick Araujo Back OFF !
    NO SEXUAL AND OFFENSIVE Material on this site Please! Kindly ask You Sir to remove your unwelcoming header !

    If you are so smart, please kindly to solve my issues with the Xojo Cloud UDP Income/Outcome! I
    'll be happy to try/work with your smart guys solution on my NY/Amsterdam/... cloud servers ... Just drop me on time when we can try !

    Zoltan
    I'm working hard at data collecting level , implementing java script state machine to my devices... I'm sure, you guys are much younger/smarter like me, but i'm trying to do my best...

or Sign Up to reply!