Click here to Skip to main content
15,887,927 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am a bit confused now. I am creating a TCP Chat App (Client-Server) and my questions is im behind a router, im the server. D
Do i also have to port-forward the TCP Port to my local computer, like the Client has to do or do i have not because im the server and the server basically waits in idle for a connection from client side?
Posted

You may need to. If you are using a local IP address of 127.0.0.1 then no any router connected to your network will be able to connect but if you are using a private ip address such as 192.168.1.678 then nobody will be able to connect. You need to find your public IP address. https://www.google.com/search?q=whats+my+public+ip+address&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a#hl=en&client=firefox-a&hs=8jV&tbo=d&rls=org.mozilla:en-US:official&spell=1&q=what%27s+my+public+ip+address&sa=X&ei=GGmZUL-IIoTH0QGdloHACg&ved=0CC0QBSgA&bav=on.2,or.r_gc.r_pw.r_qf.&fp=6badbe56f25053ec&bpcl=37189454&biw=1680&bih=957[^]
Click that link to get your public ip address. Once your public IP address is found then you need to unblock the port that you are sending and recieving tcp data with.

WARNING: DO NOT ENTER DMZPLUS MODE IF YOU ARE ON AN AT&T ROUTER. YOU WILL GET HACKED WITHIN A WEEK BECAUSE IT WILL ACCEPT ANY DATA FROM ANY PORT.

Their you go hope you continue to program you TCP/IP CHAT application :)
 
Share this answer
 
I already know how to obtain my IP programmatically but i found out that only the server needs port-forwarding, the client does not have to port-forward since he searches for connection, thanks ExcellentProducts for the tips
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900