By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,285 Members | 1,659 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,285 IT Pros & Developers. It's quick & easy.

tcpClient and binding on dual homed machine?

P: n/a
Stu
I'm using tcpClient to send data to a pocket pc from the server. The server
is dual homed and tcpClient seems to bind to the first address
(.AddressList(0)) - how do I bind that to another address (.AddressList(1)).
I need to do this because the network adapter for eth0 is on non routable
network that can't talk to anything else (on purpose). This software will
run on many different servers, so I'll need the software to be able to pick
what IP it listens on and sends on.

I know this is probably a newbe questions, but neither of the books that I
have as reference or google has provided me with much of an answer.

Thanks In Advance,

Stu

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can use the constructor which takes an IP address and port number to
bind your socket to a given adapter. That is, if your RAS IP address is
172.72.0.1 and your Ethernet IP is 172.73.0.1 and you want to use Ethernet
to make your connection to the server, you'd do something like:

xxx = new TcpClient( "172.73.0.1", clientPortNumber );

Paul T.
"Stu" <St*@thynk.us> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Has two network cards and talks to two seperate networks. Basically I'm
just trying to force the tcpclient to the network card of my choosing.
Should be a fairly simple task, but I'm stumped on how to get there.

Stu
"Brian Henry" <brianiup[remove-me]@adelphia.net> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
what do you mean by "dual homed"?
"Stu" <St*@thynk.us> wrote in message
news:eO****************@TK2MSFTNGP10.phx.gbl...
I'm using tcpClient to send data to a pocket pc from the server. The server
is dual homed and tcpClient seems to bind to the first address
(.AddressList(0)) - how do I bind that to another address

(.AddressList(1)).
I need to do this because the network adapter for eth0 is on non routable network that can't talk to anything else (on purpose). This software will run on many different servers, so I'll need the software to be able to

pick
what IP it listens on and sends on.

I know this is probably a newbe questions, but neither of the books
that I have as reference or google has provided me with much of an answer.

Thanks In Advance,

Stu



Nov 20 '05 #2

P: n/a
Sorry, previous message showed the wrong constructor used. You want to use
the one which takes an IPEndPoint, passing the local IP you want to bind to
and the local port you want to bind to when you create the IPEndPoint
instance.

Paul T.

"Stu" <St*@thynk.us> wrote in message
news:%2***************@TK2MSFTNGP11.phx.gbl...
Has two network cards and talks to two seperate networks. Basically I'm
just trying to force the tcpclient to the network card of my choosing.
Should be a fairly simple task, but I'm stumped on how to get there.

Stu
"Brian Henry" <brianiup[remove-me]@adelphia.net> wrote in message
news:uP**************@TK2MSFTNGP11.phx.gbl...
what do you mean by "dual homed"?
"Stu" <St*@thynk.us> wrote in message
news:eO****************@TK2MSFTNGP10.phx.gbl...
I'm using tcpClient to send data to a pocket pc from the server. The server
is dual homed and tcpClient seems to bind to the first address
(.AddressList(0)) - how do I bind that to another address

(.AddressList(1)).
I need to do this because the network adapter for eth0 is on non routable network that can't talk to anything else (on purpose). This software will run on many different servers, so I'll need the software to be able to

pick
what IP it listens on and sends on.

I know this is probably a newbe questions, but neither of the books
that I have as reference or google has provided me with much of an answer.

Thanks In Advance,

Stu



Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.