/    Sign up×
Community /Pin to ProfileBookmark

How to send data to a device connected on a network?

Hi there,

How can I send data (e.g. a simple “hello world”) to a device connected on a network (e.g. at ip address 192.168.0.100) ?

Thanks in advance…

to post a comment
JavaScript

8 Comments(s)

Copy linkTweet thisAlerts:
@phpnoviceJul 04.2005 — You would have to write a COM object which performs that function. Then, because you're talking about an intranet (and presuming that you use IE in your intranet), you can use the following to instantiate that COM object for use by JavaScript:

var obj = new ActiveXObject("object.class");

obj.send("192.168.0.100", "hello world");
Copy linkTweet thisAlerts:
@brickwallauthorJul 04.2005 — Hi phpnovice,

Thanks for your help, but I don't want to develop a COM, because my customer will use Linux...

Is there a way to send directly with JavaScript like a stream?

Like this:

var stream = new UnknownStream( 192.168.0.100 );

stream.writeln( "hello world" );

Thanks in advance...
Copy linkTweet thisAlerts:
@phpnoviceJul 05.2005 — Is there a way to send directly with JavaScript like a stream?

Like this:

var stream = new UnknownStream( 192.168.0.100 );

stream.writeln( "hello world" );[/QUOTE]

By itself, JavaScript cannot do that because JavaScript was never intended to be able to do what you want. IE extended JavaScript to be able to instantiate local objects to accomplish anything and everything that can be done from the local machine. However, this support will only work in a local or intranet environment -- not from the Internet. As previously stated, though, this IE support requires a COM object located on the local machine. In an Internet environment, you can only do this on the server side.
Copy linkTweet thisAlerts:
@brickwallauthorJul 05.2005 — Hum... it's an intranet environment, sorry if I don't explain this before, but this detail will change the solution?

Thanks in advance...
Copy linkTweet thisAlerts:
@phpnoviceJul 05.2005 — No, not really. You still need the COM object. Of course, there are standard COM objects available that would obviate the need to develop your own. For example... MS Office Developer or MS Office Professional would include "standard" COM objects, which you could use from an intranet web page, and which would accomplish your desired goal.
Copy linkTweet thisAlerts:
@Orc_ScorcherJul 05.2005 — What browser will your customer use? Large parts of Mozilla including the network library are scriptable if your scripts has the needed privileges.
Copy linkTweet thisAlerts:
@brickwallauthorJul 05.2005 — maybe this will help you[/QUOTE]
Hum... good article, but will not help me on this, thanks

What browser will your customer use? Large parts of Mozilla including the network library are scriptable if your scripts has the needed privileges.[/QUOTE]
Hum... I don't know exactly, in Windows environment they use IE, but they will migrate to Linux soon... is there any generic network library?

No, not really. You still need the COM object.[/QUOTE]
I was previewing this situation, but will work only on Windows environment and I need a multi-platform solution...

Thanks in advance...
×

Success!

Help @brickwall spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...