Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Corona sdk blocking Lua Socket UDP send method
Started by info3014 Jul 08 2018 10:58 AM

- - - - -
3 replies to this topic
socket udp multiplayer tcp/ip
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

info3014

[GLOBAL: userInfoPane.html]
info3014
  • Observer

  • 1 posts
  • Corona SDK

I was following Tutorial: Local multiplayer with UDP/TCP (https://coronalabs.com/blog/2014/09/23/tutorial-local-multiplayer-with-udptcp/)

 

I created a simple messaging app with socket UDP methods a while back(last year or so)however when i tested the program again using the latest 2017.3184 build, I was not able to use the udp's sendto method. 

local result,err = sendUDP:sendto( msg, "255.255.255.255", 11111 )
sendUDP:setoption( "broadcast", false )  --turn off broadcast
print("sending result: "..tostring(result).."  "..tostring(err))

outputs: 

Jul 09 02:55:06.740 sending result: nil  refused
Jul 09 02:55:06.851 sending result: nil  refused

Did some digging on lua webpage(https://rawgit.com/diegonehab/luasocket/master/doc/udp.html) and it says: 

 

"Note: In UDP, the send method never blocks and the only way it can fail is if the underlying transport layer refuses to send a message to the specified address (i.e. no interface accepts the address)."

 

Is corona sdk blocking out going messages to unconnected ip address? 

 

 

 

 



[TOPIC: post.html]
#2

Fira Soft

[GLOBAL: userInfoPane.html]
Fira Soft
  • Observer

  • 4 posts
  • Enterprise

Any chance this issue was solved?

We've just had to update one of our apps and UDP behavior seems to have changed as described.



[TOPIC: post.html]
#3

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 24,995 posts
  • Corona SDK

That's a pretty old tutorial. It's pre IPv6. Since that tutorial was written, we've updated the socket IO library to be IPv6 compliant and there are realistic chances that something changed in that library that changes how UDP behaves. Corona isn't blocking anything, but LuaSockets might be.

 

Rob



[TOPIC: post.html]
#4

agramonte

[GLOBAL: userInfoPane.html]
agramonte
  • Contributor

  • 859 posts
  • Corona SDK

About a year ago I used that same tutorial and tried to replace the UDP portion of that code with the zeroconf plugin. I did some limited testing and it worked fine, but I have yet to use it in any of my games (at this point there are better options). You can find all the code here. If I remember correctly I tried to keep all the calls exactly the same (all the tcp calls are exactly the same code) so it might be an easy replacement. If you run into any issues let me know and I'll see what I can do.

 

https://github.com/agramonte/zcrmmp/tree/master/zeroconf_mp

 

As a side note: Originally I thought Rob wrote the original code and named the entire library after him. Since then I replaced all the files that had his name.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: socket, udp, multiplayer, tcp/ip