This week's book giveaway is in the HTML Pages with CSS and JavaScript forum.
We're giving away four copies of Testing JavaScript Applications and have Lucas da Costa on-line!
See this thread for details.
Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

sockets and comm package

 
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello
i want to access serial port of a pc connected in network.. that is i want to access the com port of other pc in a network.... can i combine comm package and sockets for this? or if you can suggest some better technology to be used..... is there any facility in sockets where i can specify the com port like COM 3 because i do not know whether this is permitted in sockets....
 
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sockets are for TCP/IP traffic; you can't use them for serial communication.

The http://faq.javaranch.com/java/JavaIoFaq page points to several APIs you can use for this; search for "javax.comm".
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks... but how to do it using com package??? we have done com port identification and access the data on the port (read,write) on a standalone pc now we want to do it in a network....
how to do it... that is identify it acces it ??? i.e com port of other pc on a network...

 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What do you mean by "com package"? Some software you're using already?

COM ports are used for serial communication; when you say "network", I'm assuming that's not something set up to run over serial ports, but a standard TCP/IP network. So that wouldn't help with accessing COM ports.
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:What do you mean by "com package"? Some software you're using already?

COM ports are used for serial communication; when you say "network", I'm assuming that's not something set up to run over serial ports, but a standard TCP/IP network. So that wouldn't help with accessing COM ports.



hello
com package means comm package for communication in java..No set up....Imagine a software company where pen drives are not allowed and if someody insrts a pen drive then i should be able to detect/access it using my machine. Like read/write data from the pendrive.Is it possible wid comm package or sockets??
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Imagine a software company where pen drives are not allowed and if someody insrts a pen drive then i should be able to detect/access it using my machine. Like read/write data from the pendrive.Is it possible wid comm package or sockets??


Those devices use USB, not serial or socket communication. If you're asking whether you can detect if someone attaches a USB device on a remote machine, simply by running code on your local machine, then the answer is no. There'd at least need to be a daemon process running on each machine that detects such a thing, and which then can take appropriate action. That's not something that Java lends itself to easily, though; consider native code instead.
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:

Imagine a software company where pen drives are not allowed and if someody insrts a pen drive then i should be able to detect/access it using my machine. Like read/write data from the pendrive.Is it possible wid comm package or sockets??


Those devices use USB, not serial or socket communication. If you're asking whether you can detect if someone attaches a USB device on a remote machine, simply by running code on your local machine, then the answer is no. There'd at least need to be a daemon process running on each machine that detects such a thing, and which then can take appropriate action. That's not something that Java lends itself to easily, though; consider native code instead.


thanks
i want to access the com port of he computer next o me??? how do i do it then??? wat technology do you suggest?
i thouht i could do i using sockets,comm pkg but now its not possible.....
then could you suggest something..... for this......
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The COM port of a remote machine can be accessed through a serial connection from your local COM port. But the days when computers were networked using serial connections are long gone. What is it that you're trying to achieve?
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Ulf Dittmer wrote:The COM port of a remote machine can be accessed through a serial connection from your local COM port. But the days when computers were networked using serial connections are long gone. What is it that you're trying to achieve?




ok..i want that only...I want to access data from a mobile which is attached to com port(read.write on that port)..tell me how can i do that???
 
Ulf Dittmer
Rancher
Posts: 43016
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Java I/O FAQ I linked to mentions several Java libraries that can be used to communicate over a serial port. Consult the documentation of the device for the details of that communication.
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thnx
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
but how can we access other pc's com port,,,i have done wid single pc but how to do it in a network ie another pc..is there any method for that?
 
Ranch Hand
Posts: 490
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You want to access a com port of another computer on a network?

If they are both on a LAN, just use sockets for communication, much simpler. Otherwise you need connect com ports and use the library already mentioned.

Are you trying to do this to share files? If so, why not set up network folders via samba or whatever it is called that Windows uses for this purpose.

For the USB problem, shut off USB in the BIOS and password protect it.
 
supriya acharya
Greenhorn
Posts: 28
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Rusty Shackleford wrote:You want to access a com port of another computer on a network?

If they are both on a LAN, just use sockets for communication, much simpler. Otherwise you need connect com ports and use the library already mentioned.

Are you trying to do this to share files? If so, why not set up network folders via samba or whatever it is called that Windows uses for this purpose.

For the USB problem, shut off USB in the BIOS and password protect it.




Thanks
in the earlier conversation we were old that sockets cannot detect COM ports..... so we do no know the exact technology with which we can access the usb on the other machine......
    Bookmark Topic Watch Topic
  • New Topic