Yes, you have to set a static local ip for the computer of the lan running the server and then after enter your router's setup and forward the port and protocol (TCP or UDP) to the static local ip of the computer running the server.
With that you will be able the clients to send packets to your server, the problem will be after when your server answers, clients behind a firewall will have problems too. I suggest you thse things:
-If you are using UDP, use a unique port for both sending and receiving messages (yes, it works and it will avoid you many problems with the firewalls of routers) -Also, this is very important, let's suppose you programmed your client to send and receive the UDP packets at the port 8000, well, if the client is behind a router and the server sends a udp message directly to the port 8000 of the client, many routers (of the client) will block that message because some routers translate the port to a different port number. The server has to send the udp message to the port showed by the command UDPStreamPort() if you want the client to receive the message.
Good routers maintain the same port, but lots of routers translate the port, so if your client tries to connect to your server using the port 8000, the router of the client will translate the port to the port 50000, (for example) and only if the server sends the answer to the port 50000, the router of the client will accept the udp message and forward it to the port 8000 of the computer running the server; if the server sends directly the udp message to the port 8000, the router (nasty routers) will block the udp message.
Hope this helps you, it should save you several headaches with routers.
|