Link to home
Start Free TrialLog in
Avatar of xenia27
xenia27Flag for Taiwan, Province of China

asked on

Connecting a device...

Hi,

I try to write a program which will connect to a device through an IP address...and get the page data from the device and write it into a file.  How can I connect a device through a given IP address??  Any suggestion?  By the way, I'm using C to write the program in Red Hat 9...



Xenia
Avatar of xenia27
xenia27
Flag of Taiwan, Province of China image

ASKER

Is there any reference I can study?  About network and detecting device or anything I need to know??
> How can I connect a device through a given IP address??
you first need a server/daemon/program running on the remote host listening on that IP. This program then can access the device and return what you want.
Avatar of manav_mathur
manav_mathur

xenia27,
Can you tell us what exacly this device is?? Is it local....in that case what you are asking is to 'bind' the device interface to a particular IP address. In case the device is remote, ahoffman is correct.

Manav
Avatar of xenia27

ASKER

This device is attached with computer...I mean connected through a network wire...not sure whether I use the correct word for it or not...anyway, I need to get some information from a machine through the network...I suppose it's a local...what's the different between connecting a remove machine and a local machine?  How will the program be different???
ASKER CERTIFIED SOLUTION
Avatar of manav_mathur
manav_mathur

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Have a look at this ->

http://www.paulgriffiths.net/program/c/echoclntsrc.html

might help you.

Cheers
Manav
Avatar of xenia27

ASKER

OK...I know this might not be in my question now...but I wonder how can I read data via RS232???  Is there any reference I can study?

Thanks for the information you provide...that's excellent~~  Thanks~
Avatar of xenia27

ASKER

Does this code work in Linux?
Any other example???
It must. I havent tried coz I dont have a LINUX machine at my disposal here.

But LINUX supports berkeley sockets. Why dont you try it out??

Manav
Avatar of xenia27

ASKER

OK...I'm working these codes now...thanks for helping~~~~