cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matt Innes" <matt.in...@unity-is.com>
Subject RE: Slightly OT: accessing serial port using Java
Date Tue, 30 Nov 2004 09:24:40 GMT
>> The problem is: how do I write the part that can communicate with the
serial
>> port? I don't know if I can do this in Java and I have never written
>> software specifically for the Linux platform.

> One trick that I have used in the past was to write a small C program
> that talked to the serial port and opened a TCP socket on localhost.
> I then connected to the TCP socket from my Java application using
> the usual java.net API (this works for the parallel port too).

I would strongly recommend getting the part that interfaces to the
hardware to run in a separate process from the Web container.  A while
back I built an MP3 player  that was controllable from the Internet.
While the music playing component ran within the JBoss environment, the
music skipped every 30 seconds or so coinciding with a JBoss processor
spike.  JBoss probably did not expect to have realtime code running in a
webapp.

I then packaged the player part in an RMI object on the same machine and
controlled it from the webapp - the music now plays flawlessly.  

So, I agree with Skip in so far as you will probably have to break the
code out from the container somehow anyway.  I realise that this doesn't
address your immediate need of how to talk to the serial port, but there
is plenty of feedback on that already.

Regards,
Matt

Matt Innes, UTB Consulting
matt.innes<at>utbconsulting.com



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message