Click here to Skip to main content
15,902,832 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi
I want to connect users that are running a program over the internet with eachother, and no special port setting by the user will be required. I want the users connected directly, not through a server. a server can hand the connection off if needed, but the session should not pass through the server.

If I want to connect directly then is it possible to avoid port forwarding ? if yes How?
Posted
Comments
Sergey Alexandrovich Kryukov 25-Jun-11 0:02am    
What do you mean "not required"? Can you simply work with the fixed port (or, say, couple of ports) with fixed numbers configured on both sides, from the subset of private/dynamic port number set. If firewall allow them is a different thing, hopefully not or you can configure that.
--SA

1 solution

There is no such thing as a "direct connection" to another computer as you desribed it. There must be a port that a server is listening to that accepts incoming client requests. If you have a firewall in front of your server, some kind of port forwarding is going to be required. It sounds as though you really don't have a good idea of how TCP/IP communication works.
 
Share this answer
 
Comments
Ajit Hegde 25-Jun-11 8:43am    
I meant server as chat server or google server like that. I know what is TCP/IP and how it works.
Dave Kreskowiak 25-Jun-11 11:46am    
It doesn't seem like you do because you cannot talk over TCP/IP without using a port. Also, a server is REQUIRED. I know what you're thinking. "How do two clients talk directly to each other peer to peer without a server?" Easy. Every client is also a server!

A server is not a large PC running some exotic O/S and software. All a server is is a some process that listens for connections and responds to requests.

Every client listens for a connection from another client. In order to do that, your server code has to listen on a port number. Without that, you've got nothing.

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