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 

How does Indy handle multi IP Address on one host?

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





PostPosted: Sun Nov 21, 2004 10:06 am    Post subject: How does Indy handle multi IP Address on one host? Reply with quote



for example:
i have a host with two netcard installed.
one connected to the local network,
the other connected to the ADSL modem,
thus the host will have two IP Address
after connected to internet.

now i'm using Indy to develop a software to
communicate within my local network. but
how to let Indy use the local IP Address
not the dynamic one(allocated by ADSL
modem) when communicating?


Back to top
Don Siders
Guest





PostPosted: Sun Nov 21, 2004 10:17 am    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote




Quote:
i have a host with two netcard installed.
one connected to the local network,
the other connected to the ADSL modem,

how to let Indy use the local IP Address
not the dynamic one(allocated by ADSL
modem) when communicating?

See the documentation for the TIdTCPServer.Bindings property.



Back to top
Joe Wuang
Guest





PostPosted: Sun Nov 21, 2004 11:56 am    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote



Quote:
See the documentation for the TIdTCPServer.Bindings property.

for example: host A has two IP address, B is another host
in the same Lan with host A. the server side of my
software is running on host B, the client side is running on
host A. now the client side(on host A) send message to
server side(on host B) , how server side to get the correct
IP Address of client side ?





Back to top
Don Siders
Guest





PostPosted: Sun Nov 21, 2004 1:04 pm    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote


Quote:
how server side to get the correct
IP Address of client side ?

Please see the Server section in the Indy Knowledge Base ([url]http://www.indyproject.org/KB/)[/url].



Back to top
Joe Wuang
Guest





PostPosted: Mon Nov 22, 2004 6:54 am    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote

->Please see the Server section in the Indy Knowledge Base
([url]http://www.indyproject.org/KB/)[/url].

i did exactly the way described in KB. but always get
the wrong IP.
is there some place to specify the client to use which IP
to communicate?


Back to top
Joe Wuang
Guest





PostPosted: Mon Nov 22, 2004 1:41 pm    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote

->Please see the Server section in the Indy Knowledge Base
([url]http://www.indyproject.org/KB/)[/url].

i'm sorry.
when using TIdTCPServer or TIdUDPServer i can get the correct IP.
now i want to use IdIPMCastServer and
IdIPMCastClient. the server side is running on host A
which has two IP, the client side is running on host B.
then server side send multi-cast message and client side
on host B will receive it. how can host B get the host A's
correct IP(the IP used in local Lan).


Back to top
Don Siders
Guest





PostPosted: Mon Nov 22, 2004 2:00 pm    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote

Quote:
->Please see the Server section in the Indy Knowledge Base
([url]http://www.indyproject.org/KB/)[/url].

i did exactly the way described in KB. but always get
the wrong IP.
is there some place to specify the client to use which IP
to communicate?

I really don't undersand your question.

You have a connection established in a server thread or context. How could it be the wrong IP? What is it exactly that makes you think it's the wrong IP?

Unless you're using the wrong value...

Binding.IP - the server IP
Binding.Port - the server port number
Binding.PeerIP - the client IP
Binding.PeerPort - the client port number

hth...

Back to top
Don Siders
Guest





PostPosted: Mon Nov 22, 2004 4:51 pm    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote

Quote:
when using TIdTCPServer or TIdUDPServer i can get
the correct IP.
now i want to use IdIPMCastServer and
IdIPMCastClient.

Oh, multicast... it's different.

Quote:
the server side is running on host A
which has two IP, the client side is running on host B.
then server side send multi-cast message and client side
on host B will receive it. how can host B get the host A's
correct IP(the IP used in local Lan).

For IP Multicast, the IP address is set to the Multicast Group Address. The local network interface is always bound to INADDR_ANY (0.0.0.0), so you cannot get the real local IP address. If you need the senders end-point, you'll need to include it as part of the datagram.

For instance, using IP Multicast to notify clients when a server is online or going offline. The server information needs to be sent in a datagram since IP Multicast doesn't maintain or broadcast group membership. This type of operation is generally implemented in a higher-level protocol layered on top of the multicast mechanism.

See http://www.rfc-editor.org/rfc/rfc1458.txt.

hth

Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Mon Nov 22, 2004 7:46 pm    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote


"Joe Wuang" <joeyeah (AT) msn (DOT) com> wrote

Quote:
->Please see the Server section in the Indy Knowledge Base
([url]http://www.indyproject.org/KB/)[/url].

i did exactly the way described in KB. but always get
the wrong IP.

Please show your actual code. Where are you retreiving the IP from in the
first place? How are you passing it to Indy?

Quote:
is there some place to specify the client to use which
IP to communicate?

The client can only connect to whatever IP is running the server. If you
need the server to tell the client which IP to connect to, then the server
has to publish the IP somewhere that the client can find it.


Gambit



Back to top
Joe Wuang
Guest





PostPosted: Tue Nov 23, 2004 1:48 am    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote

Quote:
Oh, multicast... it's different.

For IP Multicast, the IP address is set to the Multicast >Group Address.
The local network interface is always >bound to INADDR_ANY (0.0.0.0), so
you cannot get >the real local IP address. If you need the senders
end->point, you'll need to include it as part of the datagram.

For instance, using IP Multicast to notify clients when a >server is online
or going offline. The server information >needs to be sent in a datagram
since IP Multicast >doesn't maintain or broadcast group membership. This
type of operation is generally implemented in a higher->level protocol
layered on top of the multicast >mechanism.

See http://www.rfc-editor.org/rfc/rfc1458.txt.

hth

thanks a lot, i know what to do now.
and thanks Remy Lebeau

best wishes



Back to top
Joe Wuang
Guest





PostPosted: Tue Nov 23, 2004 1:59 am    Post subject: Re: How does Indy handle multi IP Address on one host? Reply with quote

Quote:
Please show your actual code. Where are you retreiving the IP from in the
first place? How are you passing it to Indy?


i'm sorry for my inattention. the method
described in the KB works correctly.


Quote:
The client can only connect to whatever IP is running the server. If you
need the server to tell the client which IP to connect to, then the server
has to publish the IP somewhere that the client can find it.

thanks for your reply, i'm clear now.

best wishes



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.