c# - How to send back to a UDP source address? -
i have question concerning communication between server , client using udp. i'll first explain i'm trying do.
- the client sends message server using random udp source port static server udp port (11000).
- the server learns clients sending port.
- then server sends message client using random port clients sending port.
the problem server can send if clients random port forwarded on router. don't know if it's possible shouldn't server able send the client using same port client used send without forwarding port? read hole punching if understand correctly it's needed when want peer-to-peer connection. server had static ip. i'm trying in c#.
i hope question clear. in advance!
edit: information setup:
the client game client should able connect server location. (it's running on home pc). server located @ school , has static ip. ports on server open , server used ftp , has server running uses tcp. things work fine. tcp works because creates connection , server uses connection send client. problem udp server can't send client because udp connectionless.
like said if open ports on client works great. question is: how send client without opening ports on client? games don't require open ports. there possibility either send without port forwarding or can open port using c#?
edit2: found answer
i found answer. communicate need use same udpclient both send , receive. using 1 send , 1 receive.
degor
Comments
Post a Comment