BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sockets over the Internet

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock
View previous topic :: View next topic  
Author Message
Ian Trackman
Guest





PostPosted: Sat Apr 17, 2004 10:25 pm    Post subject: Sockets over the Internet Reply with quote



I have two Delphi 5 programs on a LAN which send simple text messages to
each other using a TServerSocket and a TClientSocket.

I now want to get them to communicate with each other over the Internet. I
get the router's IP address of the server program visually from its own
software and allocate it to the Host property of the client socket, but
nothing happens when I try to connect the two programs.

From reading other postings, it seems that I can't easily get the IP address
of the Internet connection programmatically except from the router's own
specific APIs - or can I ?

I've never tried this before, so can someone please either help me with some
basics or point me to some "how-to for dummies" documentation ?

The router/modem has a firewall and I'm running the server socket program
under XP with its firewall enabled, if that's relevant.

Is there anything in Delphi 8 that would help me ?

Ian


Back to top
Ben Hochstrasser
Guest





PostPosted: Sat Apr 17, 2004 10:33 pm    Post subject: Re: Sockets over the Internet Reply with quote



Ian Trackman wrote:

Quote:
I have two Delphi 5 programs on a LAN which send simple text messages
to each other using a TServerSocket and a TClientSocket.

I now want to get them to communicate with each other over the
Internet.

You don't need to know the router's address - the IP stack will take care
of all this. What you need is your own and the partner's IP address.

Quote:
From reading other postings, it seems that I can't easily get the IP
address of the Internet connection programmatically except from the
router's own specific APIs - or can I ?

You can. eg http://checkip.dyndns.org/ will tell you your official
(=outside) ip address. Better yet, get yourself a dyndns address and you
don't even have to know your IP.

Quote:
The router/modem has a firewall and I'm running the server socket
program under XP with its firewall enabled, if that's relevant.

If that thusly protected system is at the "receiving" end (i.e. it
answers to an incoming connection) then you have to open the firewall for
that specific port. Nothing special has to be made for the initiating
end, the firewall will let answer packets pass.

--
Ben

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Sat Apr 17, 2004 10:38 pm    Post subject: Re: Sockets over the Internet Reply with quote



"Ian Trackman" <ian (AT) bluechipbridge (DOT) co.uk> wrote


Quote:
I now want to get them to communicate with each other over
the Internet. I get the router's IP address of the server program
visually from its own software and allocate it to the Host property
of the client socket, but nothing happens when I try to connect
the two programs.

The fact that you mention a router means that the server program is running
on a private LAN, correct? If so, the router must have port forwarding
enabled in order for traffic from the outside world to reach the machine
that is running the server program.

Quote:
From reading other postings, it seems that I can't easily get the
IP address of the Internet connection programmatically except
from the router's own specific APIs - or can I ?

Assuming you are referring to the server program determining its own public
IP, you can achieve that by simply having the server query an external
source on the Internet, such as http://whatismyip.com or similar service via
HTTP, and then parse the result. As for the client determining the server's
public IP, it won't be able to do that at all unless the router has a public
host name registered for it, then the client can do a DNS lookup. Otherwise
user input is needed instead.

Quote:
The router/modem has a firewall and I'm running the server
socket program under XP with its firewall enabled, if that's relevant.

XP's firewall is a piece of junk. You should disable it and get a real
firewall instead.


Gambit



Back to top
Ian Trackman
Guest





PostPosted: Sat Apr 17, 2004 11:15 pm    Post subject: Re: Sockets over the Internet Reply with quote

<The fact that you mention a router means that the server program is running
on a private LAN, correct? If so, the router must have port forwarding
enabled >

That's presumably US Robotic's "port triggering", isn't it ?


< XP's firewall is a piece of junk. You should disable it and get a real
firewall instead. >

I have - I just disabled it in case it was getting in the way.

Ian


Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> Delphi Internet Winsock All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.