> That's because PHP doesn't listen on ports by itself, it runs within Apache > or IIS. That is why I choused PHP. I simple http connection on port 80 will be accepted by any server.
Your idea about sending only the port and letting the server to find out the IP and timestamp is also brilliant. The problem now is that the complexity of the server script will grow. Damn. I really have to buy a PHP manual. I this I was able to write a very simple PHP script but now it grow beyond my limited PHP knowledge. Anyway is almost the time to learn PHP. More and more compiled applications need some Internet connectivity today. I am not sure if I should give to the user a unique ID or if I should let the application to generate one based on the computers hardware. --- Cosmin Prund <[EMAIL PROTECTED]> wrote: > Human wrote: > > Wow. > > I really thank you all. Now I have a point from where to start. > > I imagined that I should let the user to provide the REAL IP of the > > computer and not the > internal > > IP. > > However, I did not know how to handle the firewall/NAT. But I think you are > > right: it is all > down > > to user's knowledge about how to configure its own firewall/NAT box. > > > > I think that I should try to detect the real IP then to let the user to > > choose a port that > will be > > used by the client. The user should 'open' this port in his firewall. > > So now the client will send to the server the real IP, the time stamp AND > > the port. > > > Detecting the IP should be done at the SERVER, not at the client. By the > time the connection makes it to the server it has it's source ip > properly set up to the routable IP responsible for the client's > computer. If the client's computer has a real IP address, that's the > address the server will see. If the client is behind a NAT box the > server will see the IP address associated with the NAT box. This will > save you lots of trouble in the long run (dynamic IP address kind of > trouble etc). > > Finally, you might consider simplifying the "registration" procedure for > a client. Have the client only send it's port number. The IP address > would be easily filled by the server. The time stamp would be better > handled by the server so all time-stamps are based on the same clock and > are not affected by different time-zones etc. You might also want to > include some kind of unique id for the connection so you can invalidate > a client's former IP address when the client gets assigned a new IP > address from it's ISP. > > The server application is hosted in the same place as the web site at an > > American web hosting > > company on a professional account. > > They do not have dynamic IP and I never had problems with their firewall so > > I do not need to > worry > > about this. > > > You say you never had any problems with your hosting firewall - but have > you ever tried it? Unless you tried running some strange services on the > server, listening on strange ports, you might not know if your hosting > firewall allows stuff to go through or not. Besides, this is probably > not an issue for you if you're planning on using a simple PHP page for > your "registrar". That's because PHP doesn't listen on ports by itself, > it runs within Apache or IIS. > > Ex: If a client wants to register itself it reads this page: > http://www.yourserver.yourisp.com/register.php?port=123 > Ex: A client wants the list of registered peers. It reads this page: > http://www.yourserver.yourisp.com/regsitered.php?last_query_time=123 > > __________________________________________________ > Delphi-Talk mailing list -> [email protected] > http://www.elists.org/mailman/listinfo/delphi-talk > If I choose Christianity then the Islamic will say I'm a pagan. If I choose Islamic then the Buddhism will say I'm a pagan. If I chose Buddhism then the Jewish will say I'm pagan. If I choose no God then everybody will say I'm pagan. Please, can I be free? Can you NOT tell me how I should live MY life? __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com __________________________________________________ Delphi-Talk mailing list -> [email protected] http://www.elists.org/mailman/listinfo/delphi-talk
