Udp streams question

Blitz3D Forums/Blitz3D Programming/Udp streams question

Carolinaaa(Posted 2006) [#1]
Hello, is it strictly necessary to create a udp stream for sending messages and another stream else on a different port for receiving messages?

Could be using just a unique stream and unique port for both sending and receiving UDP messages? (full duplex).

It would be very useful to bypass the firewall of routers, becase the problem now is this:

The client (behind a router) sends a udp message through port 1000, for example, to the server.

The server answers sending another udp messages to the client (being the port of the client the port 1001), the router blocks this incoming packet, even when in theory, if the router has got SPI, it should have detected that the client previously had made a request to the server, so that the router had to allow the udp message to enter, but not, it doesn't allow it.

If the sending/receiving port can be the same, then, i suppose that if the clients sends a udp message through the port 1000 and receives the udp answer from the server through the same port, the router should have to allow it, true?


Thank you.


jfk EO-11110(Posted 2006) [#2]
I don't know what your router's gonna do.

But I'm pretty sure when I coded with UDP streams lately, they MAY be using only one port to communicate, BUT only in a request/answer mode, not really full duplex.

If you have a host and multiple clients running in several windows on one desktop then you do HAVE TO use a diffrent port for client and host.

If host and client are on individual machines, the ports may be the same. It doesn't matter so much what ports you use, it's rather a question of who creates the stream. A firewall or router may block the creation of a stream from outside, even if you allow to send data over that port.

An easy solution would be to use a common port of a service that is rarely in use today. eg Telnet (port 23) or so. Common ports usually aren't blocked by routers.


Blitzplotter(Posted 2006) [#3]
Have you any source that people can 'fiddle' with to appreciate the exact nature of your problem. Despite my 'noobness' to this topic I would gladly try out anything your working on and provide you with some feedback...

regards,


Wings(Posted 2006) [#4]
Answare here.

UDP messages = Messages not session based like tcp.



1 udstream for send
1 udpstream for recive.

Udp is great for quick connections from all to all. file sharing.

tcp is more served client based. good for internet game servers.