简体   繁体   中英

Sending UDP packets across a LAN with LuaSocket

My LAN consists of a BT "Smart Hub" router, a desktop computer connected via ethernet to the router and a laptop connected via wifi to the router.

I am attempting to use a lua library called "lua socket" in order to send udp packets between the two computers.

I have copied some very generic server and client scripts from here in order to see whether or not packets are actually arriving.

My desktop is configured to have a static private IP address within the LAN and if I run both the server script and the client script using a random port and the desktop's private IP, the server successfully recieves the messages.

I was hoping that I could fire up the client script on the laptop and target the same IP and the same port and the udp packet would show up on the desktop but this doesn't seem to work.

I have many questions about this as my knowledge of networking is lacking:

Could it be that the windows firewalls of either computer or the firewall of the router are interfering with the packets?

Do I need to be sending the packets from the laptop to the default gateway and use portforwarding so they can reach the desktop?

Is the fact that the laptop is connected via wifi rather than ethernet causing a problem?

Are there more issues that I am not currently aware of?

Thanks for any advice (or pointers to further information) that you can give me.

As it turns out, the windows firewall on my desktop was configred to block all incoming data from any instances of the lua executable that I was running to execute my LuaSocket scripts.

I was running one of these on my laptop in order to execute the client side scripts.

This explains why responses from the server (when hosted on the laptop) were getting through: because they were technically from the server and not from the executable and hence got through the firewall.

Once I allowed these connections, the server correctly recieves all packets directed to its port.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM