 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Warren O. Merrill Guest
|
Posted: Wed Sep 20, 2006 4:25 am Post subject: Need help on simple understanding of connections... |
|
|
Could someone please just get me over this hurdle of understanding
connections. I'm just trying to play with a simple example program that I
downloaded called P2P Chat to start understanding how all this works.
On the dialog that pops up for the example program it has two entries that I
don't understand. One says 'Listen on and is defaulted to 1000. The other
says 'Host:' and has a default of 127.0.0.1:1000. I do understand that the
127.0.0.1 is referring to my local machine address.
What I don't understand is how to simply bring up two copies of this and see
the basics of how it works. I often get a number of errors popping up and
I'm sure its related to how the two sets of numbers are set.
1) Do I start two copies of this same test program on the same machine or
two different machines (or can it be used either way)?
2) If I start both on the same machine what settings do I use for the two
copies (i.e. both set to listen on 1000 and Host as 127.0.0.1:1000?)
3) If I use two different machines how would I set things (assuming I know
the real IP addresses of those machines)?
I know I just don't grasp yet how to set the numbers. Do the four numbers
all have to be different or the same? Is the listening number set to the
same as the Host number in the same copy of the app or the Host number of
the other copy of the app? See what I'm driving at, just a little primer
on what these mean would help me.
So please fill in the example below:
If I start two copies of the app on the local machine I should set the
params so it works as follows:
App copy #1 Listen on set to: 1000 ???
App copy #1 Host set to: 127.0.0.1:1000 ???
App copy #2 Listen on set to: 1000 ???
App copy #2 Host set to: 127.0.0.1:1000 ???
If I start two copies of the app on two different machines I should set the
params so it works as follows (I understand the basic IP part of the address
will be my own IPs):
App copy #1 Listen on set to: 1000 ???
App copy #1 Host set to: 127.0.0.1:1000 ???
App copy #2 Listen on set to: 1000 ???
App copy #2 Host set to: 127.0.0.1:1000 ??? |
|
| Back to top |
|
 |
Remy Lebeau (TeamB) Guest
|
Posted: Wed Sep 20, 2006 4:46 am Post subject: Re: Need help on simple understanding of connections... |
|
|
"Warren O. Merrill" <wom (AT) inel (DOT) gov> wrote in message
news:45107c60$1 (AT) newsgroups (DOT) borland.com...
| Quote: | On the dialog that pops up for the example program it has two entries
that I don't understand. One says 'Listen on and is defaulted to 1000.
|
That is the port number that the program will listen on when accepting
incoming connections.
| Quote: | The other says 'Host:' and has a default of 127.0.0.1:1000.
|
That is the IP and port number that the program will make outgoing
connections to.
| Quote: | What I don't understand is how to simply bring up two copies of
this and see the basics of how it works.
|
The default values are already set up for it. If you run both instances on
the same machine, then one instance will listen on port 1000, and the other
instance will connect to port 1000.
| Quote: | I often get a number of errors popping up
|
Such as?
| Quote: | Do I start two copies of this same test program on the same machine
|
If you use the default values as-is, then yes.
| Quote: | or two different machines
|
You can. You would have to change the Host value on the connecting instance
to specify the IP of the machine that the listening instance is running on.
| Quote: | or can it be used either way?
|
It can be used either way.
| Quote: | If I start both on the same machine what settings do I use for the two
copies (i.e. both set to listen on 1000 and Host as 127.0.0.1:1000?)
|
Only one instance must listen. The other connects to the listener.
| Quote: | If I use two different machines how would I set things (assuming
I know the real IP addresses of those machines)?
|
In the instance that will be connecting, simply specify the Host IP of the
listener.
| Quote: | Is the listening number set to the same as the Host number in the same
copy of the app |
No.
| Quote: | or the Host number of the other copy of the app?
|
Yes. Though it is the other way around - set the Host Port to be the same
as the listening Port.
| Quote: | If I start two copies of the app on the local machine I should set the
params so it works as follows:
App copy #1 Listen on set to: 1000 ???
App copy #1 Host set to: 127.0.0.1:1000 ???
|
An instance of the application does not connect to its own listening port.
Use one set of numbers or the other, not both.
App copy #1 Listen on set to: 1000
App copy #2 Host set to: <App1IP>:<App1Port>
App copy #2 Listen on set to: 1000
App copy #1 Host set to: <App2IP>:<App2Port>
Gambit |
|
| Back to top |
|
 |
|
|
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
|
|