From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From bogus@does.not.exist.com Tue Jun 16 18:23:34 2009 From: bogus@does.not.exist.com () Date: Wed, 17 Jun 2009 00:23:34 -0000 Subject: No subject Message-ID: =20 There is no good option. The security sandbox likely wont let you open = the com port. Modifying the java.policy file works, but is really only = practical if you are doing an enterpriseish website where you have = control of the client environment. =20 I dont think JWS is what you are looking for because you will likely = want to report the outcome of the SKU reader to the browser to populate = some field. My expierience is limited but in the past I have been able = to get windows to think of the scanner as a second keyboard almost and = it will directly populate the field. That probably depends on your = hardware though. =20 Good Luck, -- Tristan Dyer, Analyst CGI ________________________________ From: rxtx-bounces at qbang.org [mailto:rxtx-bounces at qbang.org] On Behalf = Of jpg jpg Sent: July 7, 2009 4:26 AM To: rxtx at qbang.org Subject: [Rxtx] (no subject) Hi, =20 I'm new. I want develop a web page (Windows, Linux Thin Clients) that = use a serial codebar reader. My first option is create an applet, I try = to convert the Sample "TwoWaySerialComm.java" but I can't, in fact I = don't know how I can do. =20 In the mail list I read that other people use Java Web Start. =20 What way I must follow? Do you have any documentation or sample? =20 Thank you ________________________________ Comparte tus fotos con tus amigos. M=E1s f=E1cil con Windows Live = =20 ------_=_NextPart_001_01C9FEF8.43673BB1 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
From a=20 webpage?
 
There is=20 no good option. The security sandbox likely wont let you open the com = port.=20 Modifying the java.policy file works, but is really only practical if = you are=20 doing an enterpriseish website where you have control of the client=20 environment.
 
I dont=20 think JWS is what you are looking for because you will likely want to = report the=20 outcome of the SKU reader to the browser to populate some field. My = expierience=20 is limited but in the past I have been able to get windows to think = of the=20 scanner as a second keyboard almost and it will directly populate the = field.=20 That probably depends on your hardware though.
 

Good = Luck,
--
Tristan Dyer,=20 Analyst

CGI


From: rxtx-bounces at qbang.org=20 [mailto:rxtx-bounces at qbang.org] On Behalf Of jpg = jpg
Sent: July=20 7, 2009 4:26 AM
To: rxtx at qbang.org
Subject: [Rxtx] = (no=20 subject)

Hi,
 
I'm new. I want develop a web page (Windows, = Linux Thin=20 Clients) that use a serial codebar reader. My first option is = create an=20 applet, I try to convert the Sample "TwoWaySerialComm.java" but I = can't, in=20 fact I don't know how I can do.
 
In the mail list I read that other people use = Java Web=20 Start.
 
What way I must follow? Do you have any = documentation or=20 sample?
 
Thank you


Comparte tus fotos con tus amigos. M=E1s f=E1cil con Windows Live = ------_=_NextPart_001_01C9FEF8.43673BB1-- From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI function > > call?). > > Either the JNI code checks the Thread.interrupted() flag, are there implementations doing that? > or cancel() invokes native code for interrupted an ongoing read > operation. How to interrupt a running select() or a blocking read() from another thread in the JNI? I remember once I wanted/needed such a functionality but found myself unable to do anything. Some URL or so would be appreciated :) > > But reading zero bytes because requested zero bytes is not an > > exception. > > Whether it was requested or not is not the issue. The fact that > there are multiple possible reasons for returning 0 bytes. Yes, but same for 1, 2, ... bytes. Can happen because that many bytes are in the OS / VM queue or because the caller requested it. Why handling zero as something special? Isn't it just a number like one or two? > requires us to disambiguate between somehow. What happens if > you request 0 bytes on a closed stream? I think this is a bug (miss-use) and would expect an exception. > Is it returning 0 because you requested zero bytes or because > the stream is closed? No, why handling zero as something special? 1 cannot be returned but an exception would be thrown, so 0 cannot be returned. 2 and 3 also cannot be returned but IMHO should lead to an exception. > >I think this depends on the design. If you have a source/sink or > >proactor style design, async I/O may be suited, but if you have > >some sync approach, implementing it by async I/O probably isn't > >good. > > Fair enough, but I fail to see why timeouts are best > implemented in terms of synchronous APIs in the first place. > Historically, calls that block for a long while tend to lead to > asynchronous event-driven models. How can a asynchronous call block? Of course, async libs usually have a synchronous call, too (e.g. some wait() or wait_result()). In asynchronous systems / designs AFAIK you usually get some event or can poll/check for it. Timeouts appear on higher layers (due to the fact that no event was received within some time). If I understood correctly, this is what Michael Erskine uses (as posted here on May, 26th). Interestingly, when implementing some BSD socket style API (e.g. inside some kernel or low layer lib), I mean something offering read/write/select (synchronous), for this implementation internally async APIs may be suited well. When events (interrupts) arrive, the data is buffered, a notify() performed and threads inside a select recheck queues and so on. This implementation itself may have absolutely no clue about timeouts, internally. (in practice of course something is needed at least to free some resources in strange states, I think in TCP this could be FIN_WAIT2) > > Why is UDP no socket? In socket(2), which is quite old, > > since ages it works. Maybe in NIO3 they fix it. > > The decision to separate TCP and UDP sockets goes back to Java > 1.0. They contain different methods and have different > capabilities. Yes, in Java, but not in reality. In reality, of course you can stream UDP (you don't have to, but you can). Isn't it a pitty that a NIO2 design bug is because of a mistake in Java 1.0 - especially when considering that the APIs are 100% incompatible? > I don't foresee them getting merged anytime soon. yeah, I think you could be right... (This is the usual time to ask why a space shuttle booster has the width of the back-ends of two war-horses: http://www.astrodigital.org/space/stshorse.html :-)) > >IMHO, this is just another way of saying `you can replace the > >entire functional facility completely'. > >Yeah, you can even replace the entire JVM or invent your own > >programming language :-) > >It is nice when features can be disabled or replaced completely, > >because you have a `last resort method', but this possibility > >IMHO cannot be used in an argumentation pro this features. > >This would be like saying `this feature is great. You can replace > >it by a feature doing whatever you want' which IMHO tells nothing > >:) > > The documentation doesn't talk about *replacing* anything. It > says you can provide your own Channels. That means you can > *extend* the existing API by adding more Channels (without > throwing the old ones away). No, I don't think so. I don't think you can extend it, because it is trick-code in JNI. All of this is guessed, but I think it is very reasonable. You cannot extend e.g. String because of the same reason. > We won't know for sure until > someone answers > http://stackoverflow.com/questions/911780/how-do-i-define-my-own-selectablechannel `If you do this, however, be careful not to copy code from the JDK source unless you can obey the license' lol Other developers do not copy code because of DRY. But anyway. As I understand the answers, not knowing whether they are correct, they more or less tell `you can write your own JNI stuff and use it independently from the existing one' - which IMHO is another way of saying `replace'. > > > Java needs to support non-POSIX operating systems that don't > > > have the same functionality which is why it can't use a > > > one-to-one mapping with POSIX. > > > >why did they copy POSIX select(2) then? > > You asked why they didn't copy the POSIX API 100%. My point is > that they had to abstract away POSIX capabilities in terms of > what could be implemented across all platforms. Well, but the result is that the `solution' does not abstract on any single platform (in constrast to POSIX, which does abstract on all POSIX platforms), is more powerful, well-thought and so on, and AFAIK older that Java. > > The JVM should abstract from the platform. It should be the > > one and only platform the application needs to care about. > > For example me, personally, wants to select over anything > > readable :) > > Maybe this makes sense under Linux, but under Windows not > everything that is readable is selectable. First, it depends on the library you are using. When using cygwin, for instance, you can select serial ports. Don't know the state of native windows serial implemenation. Windows is a bit like Java. You need a different function to read a serial port like you need to read a TCP port. Well, on windows, someone must be lucky that you can use one and the same function to read any serial port (ten years ago there where embedded APIs that had some `getc_com1', `getc_com2' and so on). > > just BTW: accept() is IMHO not specific to sockets but to > > multiplexing. > > How do you apply accept() to a file? A file isn't multiplexed. If it is by running a higher level protocol, let's say PPP, IP and TCP you can accept of course. This is what pppd is doing on by default STDIN :) oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From cowwoc at bbs.darktech.org Wed Jun 3 00:07:32 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 02:07:32 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> Message-ID: <4A261324.90006@bbs.darktech.org> Steffen DETTMER wrote: >> Either the JNI code checks the Thread.interrupted() flag, > > are there implementations doing that? No idea, but it's definitely doable. Win32 ReadFile() -- which I will discuss below -- allows you to start an asynchronous read and regularly check Thread.interrupted() to know if you should abort. >> or cancel() invokes native code for interrupted an ongoing read >> operation. > > How to interrupt a running select() or a blocking read() from > another thread in the JNI? > I remember once I wanted/needed such a functionality but found > myself unable to do anything. Some URL or so would be > appreciated :) If you use win32 ReadFile() in coordination with CancelIo() you can do exactly that. You start an asynchronous read and cancel it from the same or different thread using CancelIo(). >>> But reading zero bytes because requested zero bytes is not an >>> exception. >> Whether it was requested or not is not the issue. The fact that >> there are multiple possible reasons for returning 0 bytes. > > Yes, but same for 1, 2, ... bytes. Can happen because that many > bytes are in the OS / VM queue or because the caller requested > it. Why handling zero as something special? Isn't it just a > number like one or two? Reading zero bytes is different because you could end up reading zero bytes forever. If you've read at least 1 byte at least you're making progress towards the end of stream. When you read zero you need to know whether you should terminate the loop or not. >> Fair enough, but I fail to see why timeouts are best >> implemented in terms of synchronous APIs in the first place. >> Historically, calls that block for a long while tend to lead to >> asynchronous event-driven models. > >> The decision to separate TCP and UDP sockets goes back to Java >> 1.0. They contain different methods and have different >> capabilities. > > Yes, in Java, but not in reality. In reality, of course you can > stream UDP (you don't have to, but you can). > > Isn't it a pitty that a NIO2 design bug is because of a mistake > in Java 1.0 - especially when considering that the APIs are 100% > incompatible? Calling this a design bug is questionable. You have no idea why the authors made this decision. They might have had a very good reason for it. >> I don't foresee them getting merged anytime soon. > > yeah, I think you could be right... > > (This is the usual time to ask why a space shuttle booster > has the width of the back-ends of two war-horses: > http://www.astrodigital.org/space/stshorse.html :-)) ... they could have shipped rocket boosters by truck. Backwards compatibility is popular because at the end of the day it costs less. You can hardly blame people for that. Does the desire for bigger rocket boosters really justify retrofitting all trains across the country with wider tracks? Apparently they didn't have enough use-cases to justify such a radical change. >> The documentation doesn't talk about *replacing* anything. It >> says you can provide your own Channels. That means you can >> *extend* the existing API by adding more Channels (without >> throwing the old ones away). > > No, I don't think so. I don't think you can extend it, because it > is trick-code in JNI. All of this is guessed, but I think it is > very reasonable. You cannot extend e.g. String because of the > same reason. String cannot be extended purely for security reasons. Joshua Bloch has discussed this in Effective Java book and in interviews he's given over the years. > As I understand the answers, not knowing whether they are > correct, they more or less tell `you can write your own JNI > stuff and use it independently from the existing one' - which > IMHO is another way of saying `replace'. Not exactly. You can add your own Channel so long as you provide your own Selector implementation. The only thing you currently cannot do is add a new Channel and reuse the existing Selector implementation. That being said, it's not a big deal. You are not replacing the Channel implementation, rather adding a new one (which would be different for RS232 anyway!) alongside the default one. Existing channels use the old Selector, your new channels use the new Selector. >> You asked why they didn't copy the POSIX API 100%. My point is >> that they had to abstract away POSIX capabilities in terms of >> what could be implemented across all platforms. > > Well, but the result is that the `solution' does not abstract on > any single platform (in constrast to POSIX, which does abstract > on all POSIX platforms), is more powerful, well-thought and > so on, and AFAIK older that Java. What do you mean it doesn't abstract on any single platform? As far as I can see, it abstracts over *all* the supported platforms, which is a superset of what POSIX provides. Gili From Steffen.DETTMER at ingenico.com Wed Jun 3 04:03:59 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Wed, 3 Jun 2009 12:03:59 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A261324.90006@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> Message-ID: <20090603100359.GB7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 02:07 -0400: > Steffen DETTMER wrote: > >>Either the JNI code checks the Thread.interrupted() flag, > > > >are there implementations doing that? > > No idea, but it's definitely doable. Win32 ReadFile() -- which > I will discuss below -- allows you to start an asynchronous > read and regularly check Thread.interrupted() to know if you > should abort. But then internally this implementation would need to poll the read file result and Thread.interrupted() (probably alternating with some sleep(50) in between) and thus would not scale, right? I guess a better example could be synchrous read and having the Thread.interrupt() method (which then will be called by another thread that wishes to cancel this one) overloaded to call CancelSynchronousIo if the ReadFile() is still active (in the thread), in case someone has vista specific software. > If you use win32 ReadFile() in coordination with CancelIo() you > can do exactly that. You start an asynchronous read and cancel > it from the same or different thread using CancelIo(). Or, if using async I/O, someone could use an async approach and would not have those issues at all :-) > Reading zero bytes is different because you could end up > reading zero bytes forever. If you've read at least 1 byte at > least you're making progress towards the end of stream. I think 0 and 1 make the same progress towards the end of the infinite stream (infinite number of bytes left in both cases). > When you read zero you need to know whether you should > terminate the loop or not. I think this a dangerous miss-assumption... The chunk size (number of bytes read in a call) in nonblocking I/O IMHO usually should not be considered. > > Isn't it a pitty that a NIO2 design bug is because of a > > mistake in Java 1.0 - especially when considering that the > > APIs are 100% incompatible? > > Calling this a design bug is questionable. You have no idea why > the authors made this decision. They might have had a very good > reason for it. Yes, maybe, then it would be a documentation bug. But I have to admit that I have difficulties to imagine why it could be good not to additional support an essential, natural UDP functionality. In general, if all the experienced systems (like POSIX) do something in a uniform common way and someone else does a detail essentially different, often there are chances that this is wrong. > >>I don't foresee them getting merged anytime soon. > > > >yeah, I think you could be right... > > > >(This is the usual time to ask why a space shuttle booster > > has the width of the back-ends of two war-horses: > > http://www.astrodigital.org/space/stshorse.html :-)) > > ... they could have shipped rocket boosters by truck. Backwards > compatibility is popular because at the end of the day it costs less. > You can hardly blame people for that. NIO is not compatible to InputStream. Having no Backward compatibility but historically inherited weaknesses at the same time is a different story I think. > >No, I don't think so. I don't think you can extend it, because it > >is trick-code in JNI. All of this is guessed, but I think it is > >very reasonable. You cannot extend e.g. String because of the > >same reason. > > String cannot be extended purely for security reasons. Joshua > Bloch has discussed this in Effective Java book and in > interviews he's given over the years. Do you have a link? With google, I was unable to find related information. Security reasons? Do you mean safety reasons? I can and may want to run java applications as root and of course java itself could be replaced (with a version without this `security' feature), so what should it help? > >Well, but the result is that the `solution' does not abstract on > >any single platform (in constrast to POSIX, which does abstract > >on all POSIX platforms), is more powerful, well-thought and > >so on, and AFAIK older that Java. > > What do you mean it doesn't abstract on any single > platform? There is no platform implementation existing, where you can select/read/write with the same implementation on Sockets and other files (serial ports, ...). No such implementation exists because the design does not allow it (e.g. because not even an interface having select/read/write, for instance). oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From linuxguy123 at gmail.com Wed Jun 3 08:09:47 2009 From: linuxguy123 at gmail.com (Linuxguy123) Date: Wed, 03 Jun 2009 08:09:47 -0600 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <1244038187.3727.2.camel@localhost.localdomain> On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > read file result and Thread.interrupted() (probably alternating > with some sleep(50) in between) and thus would not scale, right? rxtx is a serial port library. How much scaling of serial port functionality do you need ? How many serial ports does your machine have ? From cowwoc at bbs.darktech.org Wed Jun 3 09:37:11 2009 From: cowwoc at bbs.darktech.org (cowwoc) Date: Wed, 03 Jun 2009 11:37:11 -0400 Subject: [Rxtx] performance compromises In-Reply-To: <20090603100359.GB7909@elberon.bln.de.ingenico.com> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> Message-ID: <4A2698A7.5070300@bbs.darktech.org> Steffen DETTMER wrote: > I think 0 and 1 make the same progress towards the end of the > infinite stream (infinite number of bytes left in both cases). The vast majority of InputStreams are finite. In fact, RXTX's is the first implementation I've seen where this isn't the case. > In general, if all the experienced systems (like POSIX) do > something in a uniform common way and someone else does a detail > essentially different, often there are chances that this is > wrong. This reminds me of http://www.astrodigital.org/space/stshorse.html except that this time POSIX is the established standard. >> String cannot be extended purely for security reasons. Joshua >> Bloch has discussed this in Effective Java book and in >> interviews he's given over the years. > > Do you have a link? With google, I was unable to find related > information. > Security reasons? Do you mean safety reasons? I can and may want > to run java applications as root and of course java itself could > be replaced (with a version without this `security' feature), so > what should it help? Try http://www.infoq.com/presentations/effective-api-design and http://java.sun.com/docs/books/effective/ > There is no platform implementation existing, where you can > select/read/write with the same implementation on Sockets and > other files (serial ports, ...). No such implementation exists > because the design does not allow it (e.g. because not even an > interface having select/read/write, for instance). That's fair. You might want to run this question by someone who knows more about it: jsr-203-comments at jcp.org Gili From tjarvi at qbang.org Wed Jun 3 19:58:26 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Wed, 3 Jun 2009 19:58:26 -0600 (MDT) Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: On Wed, 3 Jun 2009, Linuxguy123 wrote: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: >> >> But then internally this implementation would need to poll the >> read file result and Thread.interrupted() (probably alternating >> with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need ? How many serial ports does your machine > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. -- Trent jarvi tjarvi at qbang.org From michael.erskine at ketech.com Thu Jun 4 02:16:11 2009 From: michael.erskine at ketech.com (Michael Erskine) Date: Thu, 4 Jun 2009 09:16:11 +0100 Subject: [Rxtx] performance compromises In-Reply-To: References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <06BA3262D918014F9183B66425D5A8D463D3484048@no-sv-03.ketech.local> > > rxtx is a serial port library. How much scaling of serial port > > functionality do you need ? How many serial ports does your machine > > have ? > 64 ports is not that unusual. ~200 is about the max I've heard of. I have 256 virtual com0com ports and nine physical ports on my windows XP machine - the limit is a million. Erm, I don't use them all at once! Regards, Michael Erskine. From Steffen.DETTMER at ingenico.com Thu Jun 4 02:19:44 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:19:44 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <1244038187.3727.2.camel@localhost.localdomain> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <1244038187.3727.2.camel@localhost.localdomain> Message-ID: <20090604081944.GE7909@elberon.bln.de.ingenico.com> (OT) * Linuxguy123 wrote on Wed, Jun 03, 2009 at 08:09 -0600: > On Wed, 2009-06-03 at 12:03 +0200, Steffen DETTMER wrote: > > But then internally this implementation would need to poll the > > read file result and Thread.interrupted() (probably alternating > > with some sleep(50) in between) and thus would not scale, right? > > rxtx is a serial port library. How much scaling of serial port > functionality do you need? Some weeks ago it was already agreed here on the list that for rxtx performance is no main issue. However, designs and approaches should not depend or be limited on it. Or, as in this particular case, not to be changed to something that probably isn't that much better. > How many serial ports does your machine have ? 32. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From Steffen.DETTMER at ingenico.com Thu Jun 4 02:29:13 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Thu, 4 Jun 2009 10:29:13 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A2698A7.5070300@bbs.darktech.org> References: <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> <20090602092129.GJ18419@elberon.bln.de.ingenico.com> <4A261324.90006@bbs.darktech.org> <20090603100359.GB7909@elberon.bln.de.ingenico.com> <4A2698A7.5070300@bbs.darktech.org> Message-ID: <20090604082913.GF7909@elberon.bln.de.ingenico.com> (OT) * cowwoc wrote on Wed, Jun 03, 2009 at 11:37 -0400: > > > String cannot be extended purely for security reasons. > > > Joshua Bloch has discussed this in Effective Java book and > > > in interviews he's given over the years. > > > > Do you have a link? With google, I was unable to find related > > information. > > Security reasons? Do you mean safety reasons? I can and may > > want to run java applications as root and of course java > > itself could be replaced (with a version without this > > `security' feature), so what should it help? > > Try http://www.infoq.com/presentations/effective-api-design and > http://java.sun.com/docs/books/effective/ Thanks for the links, but could you please be a bit more specific? The one is a one hour video probably talking about general design principles, for instance, not to use exceptions for control flow, which was one point I also mentioned. At the other link I also could not find about String security limitations. But it is not so important. oki, Steffen About Ingenico: Ingenico is the world?s leading provider of payment solutions, with over 15 million terminals deployed across the globe. Delivering the very latest secure electronic payment technologies, transaction management and the widest range of value added services, Ingenico is shaping the future direction of the payment solutions market. Leveraging on its global presence and local expertise, Ingenico is reinforcing its leadership by taking banks and businesses beyond payment through offering comprehensive solutions, a true source of differentiation and new revenues streams. This message may contain confidential and/or privileged information. If you are not the addressee or authorized to receive this for the addressee, you must not use, copy, disclose or take any action based on this message or any information herein. If you have received this message in error, please advise the sender immediately by reply e-mail and delete this message. Thank you for your cooperation. P Please consider the environment before printing this e-mail From gk at karko.net Thu Jun 4 12:29:39 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Thu, 04 Jun 2009 20:29:39 +0200 Subject: [Rxtx] RxTx hangs on writeByte Message-ID: <4A281293.3050405@karko.net> This is driving me crazy so maybe someone can help :-( I've used RxTx in numerous projects and out of the sudden it stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build and they all give me the same result: I can open the port. I can read from the port no problem. When I try to write, the rxtx's writeByte native method (yes, I've installed the java source code and debugged as far as that) doesn't send anything and it doesn't even return - it just locks up indefinitely. I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets this with built in COM port on XP SP2. On Linux everything is fine. Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails for me. Please tell me, what I can do? The RxTx never gave me any trouble before. Best regards, Grzegorz Krugly From tjarvi at qbang.org Thu Jun 4 20:30:57 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Thu, 4 Jun 2009 20:30:57 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A281293.3050405@karko.net> References: <4A281293.3050405@karko.net> Message-ID: On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > This is driving me crazy so maybe someone can help :-( > > I've used RxTx in numerous projects and out of the sudden it stopped working > on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has mismatching > pre1/pre2 native/jar packend into bins zip) and even Cloudhopper's 2.2 build > and they all give me the same result: > > I can open the port. > I can read from the port no problem. > When I try to write, the rxtx's writeByte native method (yes, I've installed > the java source code and debugged as far as that) doesn't send anything and > it doesn't even return - it just locks up indefinitely. > > I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on Vista > SP1. I'm using Prolific USB-Serial adapter and my customer gets this with > built in COM port on XP SP2. > > On Linux everything is fine. > > Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java fails > for me. > > Please tell me, what I can do? The RxTx never gave me any trouble before. > Hi Grzegorz Do you have some simple reproduction code? Perhaps opening the port with the same settings and calling write? Is hardware flow control involved? -- Trent Jarvi tjarvi at qbang.org From gk at karko.net Fri Jun 5 02:14:38 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 10:14:38 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> Message-ID: <4A28D3EE.6000501@karko.net> Hi Trent, Thanks for replying :) I tried SimpleWrite from Sun (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I did to the linked code is changing String defaultPort in line 64 to "COM5". Is it possible to turn on some logging in the dll or perhaps download its debug version so I can see what happens inside? From java debugger I can see that it calls native writeByte method which never returns. Trent Jarvi pisze: > > > On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: > >> This is driving me crazy so maybe someone can help :-( >> >> I've used RxTx in numerous projects and out of the sudden it stopped >> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >> mismatching pre1/pre2 native/jar packend into bins zip) and even >> Cloudhopper's 2.2 build and they all give me the same result: >> >> I can open the port. >> I can read from the port no problem. >> When I try to write, the rxtx's writeByte native method (yes, I've >> installed the java source code and debugged as far as that) doesn't >> send anything and it doesn't even return - it just locks up >> indefinitely. >> >> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >> this with built in COM port on XP SP2. >> >> On Linux everything is fine. >> >> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >> fails for me. >> >> Please tell me, what I can do? The RxTx never gave me any trouble >> before. >> > > > Hi Grzegorz > > Do you have some simple reproduction code? Perhaps opening the port > with the same settings and calling write? > > Is hardware flow control involved? > > -- > Trent Jarvi > tjarvi at qbang.org From johnco3 at gmail.com Fri Jun 5 12:46:45 2009 From: johnco3 at gmail.com (John Coffey) Date: Fri, 5 Jun 2009 14:46:45 -0400 Subject: [Rxtx] web interface In-Reply-To: <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I was wondering whether there have been any updates to the rxtx 2.2 code base after all the discussion recently regarding streams etc. I wanted to try out the latest/greteat mainline code to see if there has been any regression. My code uses both polling and event driven IO - depending on what its connecting to, and the discussion about changes to timeouts & streams is a little scary if its gonig to affect existing behavior. I extracted the 2.2 code base but I did'nt see any changes, Is the mainline in some special hidden location not published in the wiki? or have there been no checkins since the pre-release 2.2. Thanks John Coffey On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. I'm a remote user too. The following > was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as per > the > >> wiki (in an effort to make some local changes using the latest patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error - using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. We do not have a web > >> > server on that machine. You can use any normal cvs related tools on > the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Fri Jun 5 15:07:46 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Fri, 05 Jun 2009 23:07:46 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A28D3EE.6000501@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> Message-ID: <4A298922.2080606@karko.net> Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for blaming the library and wasting Your time. Grzegorz Krug?y pisze: > Hi Trent, > > Thanks for replying :) > > I tried SimpleWrite from Sun > (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) > which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only > change I did to the linked code is changing String defaultPort in line > 64 to "COM5". > > Is it possible to turn on some logging in the dll or perhaps download > its debug version so I can see what happens inside? From java debugger > I can see that it calls native writeByte method which never returns. > > > > Trent Jarvi pisze: >> >> >> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >> >>> This is driving me crazy so maybe someone can help :-( >>> >>> I've used RxTx in numerous projects and out of the sudden it stopped >>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>> Cloudhopper's 2.2 build and they all give me the same result: >>> >>> I can open the port. >>> I can read from the port no problem. >>> When I try to write, the rxtx's writeByte native method (yes, I've >>> installed the java source code and debugged as far as that) doesn't >>> send anything and it doesn't even return - it just locks up >>> indefinitely. >>> >>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer >>> gets this with built in COM port on XP SP2. >>> >>> On Linux everything is fine. >>> >>> Even >>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>> fails for me. >>> >>> Please tell me, what I can do? The RxTx never gave me any trouble >>> before. >>> >> >> >> Hi Grzegorz >> >> Do you have some simple reproduction code? Perhaps opening the port >> with the same settings and calling write? >> >> Is hardware flow control involved? >> >> -- >> Trent Jarvi >> tjarvi at qbang.org > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 18:51:15 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 18:51:15 -0600 (MDT) Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: <4A298922.2080606@karko.net> References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: Hi Grzegorz, Could you go into a little detail with regards to the problem and what you identified? Was there an upgrade that fixed the problem? If not I'd like to follow up with the vendor offline. Help out others that may read the list archives and let me know off line if there is an action item remaining with the vendor please. It almost sounds like it involved hardware flow control. On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > Seems to be a problem with Prolific 2303 adapter Windows drivers, sorry for > blaming the library and wasting Your time. > > > Grzegorz Krug?y pisze: >> Hi Trent, >> >> Thanks for replying :) >> >> I tried SimpleWrite from Sun >> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) which >> uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The only change I >> did to the linked code is changing String defaultPort in line 64 to "COM5". >> >> Is it possible to turn on some logging in the dll or perhaps download its >> debug version so I can see what happens inside? From java debugger I can >> see that it calls native writeByte method which never returns. >> >> >> >> Trent Jarvi pisze: >>> >>> >>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>> >>>> This is driving me crazy so maybe someone can help :-( >>>> >>>> I've used RxTx in numerous projects and out of the sudden it stopped >>>> working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 (which has >>>> mismatching pre1/pre2 native/jar packend into bins zip) and even >>>> Cloudhopper's 2.2 build and they all give me the same result: >>>> >>>> I can open the port. >>>> I can read from the port no problem. >>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>> installed the java source code and debugged as far as that) doesn't send >>>> anything and it doesn't even return - it just locks up indefinitely. >>>> >>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and on >>>> Vista SP1. I'm using Prolific USB-Serial adapter and my customer gets >>>> this with built in COM port on XP SP2. >>>> >>>> On Linux everything is fine. >>>> >>>> Even http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>> fails for me. >>>> >>>> Please tell me, what I can do? The RxTx never gave me any trouble before. >>>> >>> >>> >>> Hi Grzegorz >>> >>> Do you have some simple reproduction code? Perhaps opening the port with >>> the same settings and calling write? >>> >>> Is hardware flow control involved? >>> >>> -- >>> Trent Jarvi >>> tjarvi at qbang.org >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From tjarvi at qbang.org Fri Jun 5 19:54:22 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Fri, 5 Jun 2009 19:54:22 -0600 (MDT) Subject: [Rxtx] web interface In-Reply-To: References: <4ec9eab60904240343t1c554d67ra5be1c5f8c573d49@mail.gmail.com> <4ec9eab60904250020tb0ec67bwf275ac232b2e3751@mail.gmail.com> Message-ID: I'll follow up on this tomorrow afternoon. On Fri, 5 Jun 2009, John Coffey wrote: > I was wondering whether there have been any updates to the rxtx 2.2 code > base after all the discussion recently regarding streams etc.? I wanted to > try out the latest/greteat mainline code?to see if there has been any > regression.? My code?uses both polling and event driven IO - depending on > what its connecting to, and the discussion about changes to timeouts & > streams is a little scary if its gonig to affect existing behavior.?? I > extracted the 2.2 code base but I did'nt see any changes, Is the mainline in > some special hidden location not published in the wiki?? or have there been > no checkins since the pre-release 2.2. > ? > Thanks > ? > John Coffey > On Sat, Apr 25, 2009 at 3:20 AM, Santosh wrote: > Hi John, > > You may be trying to connect from office network, may be some > proxy issue. > I can't connect from office but works well from home internet. > > Thank you. > Santosh > > On Fri, Apr 24, 2009 at 5:16 PM, Trent Jarvi wrote: > > > > I can't reproduce your problem. ?I'm a remote user too. ?The > following was > > done in tcsh. > > > > > > [jarvitlinux:/home/tjarvi]459 % setenv CVSROOT > > :pserver:anonymous at cvs.milestonesolutions.com:/usr/local/cvsroot > > [jarvitlinux:/home/tjarvi]460 % cvs login > > Logging in to > > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > > CVS password: > > [jarvitlinux:/home/tjarvi]461 % cvs co -r commapi-0-0-1 rxtx-devel > > cvs checkout: Updating rxtx-devel > > U rxtx-devel/.cvsignore > > U rxtx-devel/AUTHORS > > U rxtx-devel/BeOS > > U rxtx-devel/COPYING > > U rxtx-devel/ChangeLog > > U rxtx-devel/INSTALL > > U rxtx-devel/Makefile.am > > > > > > > > On Fri, 24 Apr 2009, John Coffey wrote: > > > >> Trent, I tried to grab the latest code from the cvs repository as > per the > >> wiki (in an effort to make some local changes using the latest > patches > >> etc.), I might be doing something wrong but I failed to extract the > latest > >> via the instructions in > >> http://rxtx.qbang.org/wiki/index.php/Retrieving_Source_Code. > >> > >> I get the following Connection refused error?- using the password > >> described > >> in the wiki. > >> > >> $ cvs login > >> Logging in to > >> > :pserver:anonymous at cvs.milestonesolutions.com:2401/usr/local/cvsroot > >> CVS password: > >> I receive... > >> cvs [login aborted]: connect to [cvs.milestonesolutions.com]:2401 > failed: > >> Connection refused > >> [jcoffey at arwlinux ~/temp Fri Apr 24 15:48:15] > >> > >> Any help would be appreciated. > >> > >> John Coffey > >> > >> > >> On Fri, Apr 24, 2009 at 7:53 AM, Trent Jarvi > wrote: > >> > > >> > > >> > On Fri, 24 Apr 2009, Santosh wrote: > >> > > >> >> Hello, > >> >> > >> >> Is there a web interface to rxtx source cvs repository? > >> >> Where one can see file change history using a web browser. > >> >> > >> > > >> > Hi Santosh > >> > > >> > The rxtx CVS repository is on a remote server. ?We do not have a > web > >> > server on that machine. ?You can use any normal cvs related tools > on the > >> > repo though. > >> > > >> > -- > >> > Trent Jarvi > >> > tjarvi at qbang.org > >> > _______________________________________________ > >> > Rxtx mailing list > >> > Rxtx at qbang.org > >> > http://mailman.qbang.org/mailman/listinfo/rxtx > >> > > >> > >> > >> > > > > > > From gk at karko.net Sat Jun 6 03:13:20 2009 From: gk at karko.net (=?ISO-8859-2?Q?Grzegorz_Krug=B3y?=) Date: Sat, 06 Jun 2009 11:13:20 +0200 Subject: [Rxtx] RxTx hangs on writeByte In-Reply-To: References: <4A281293.3050405@karko.net> <4A28D3EE.6000501@karko.net> <4A298922.2080606@karko.net> Message-ID: <4A2A3330.9000409@karko.net> Hi Trent, I'll be glad to help out the others by describing my problem in details, only the point is I still don't know what happened. I have two Serial to USB adapters (no-name brand) that use Prolific 2303 chips. They work on Linux without any problems but there seems to be a problem with the latest Prolific Windows drivers. Just after installing them and rebooting, when I go to Hardware Manager, I can see a yellow exclamation mark on the COM port and it says "Code 10 device cannot be started" in the details. So, I googled around and found a solution that involved installing some GPS device drivers that apparently use the same chipset. It seemed to work at first so I forgot about it. But after some time, the adapters seem to start hanging on write operations. I have no idea about hardware flow control, I never used it and am a software developer, not a serial communications specialist ;) so I know very little about how it all works. I blamed the RxTx library because I've checked everything using an old program written in Delphi, but it turns out that when the problem occurs, it occurs system-wide. The only solution is to turn off the computer and wait some time, if there's anything I can do to diagnose the problem, You'll need to tell me what to do, because I lack expertise to do it by myself. Only thing I noticed is that something the driver does must brake something inside the adapter, because when I later try to use it on other Windows machines, it won't work either. Reboot to Linux and the problem doesn't exist, reboot back to Windows not having waited some time (for the adapter to "cool down" maybe?) and the problem is still there. Fortunately my customer will use ftdi-based adapters so I stopped bothering about prolific ones. I realize this all seems convoluted, sorry for not being clear enough on the problem, I don't understand it, too ;-) If You'd like to know anything more specific about my setup or want me to run some tests, please tell me. Best regards, Grzegorz Trent Jarvi pisze: > > Hi Grzegorz, > > Could you go into a little detail with regards to the problem and what > you identified? Was there an upgrade that fixed the problem? If not > I'd like to follow up with the vendor offline. > > Help out others that may read the list archives and let me know off > line if there is an action item remaining with the vendor please. > > It almost sounds like it involved hardware flow control. > > On Fri, 5 Jun 2009, Grzegorz Krug?y wrote: > >> Seems to be a problem with Prolific 2303 adapter Windows drivers, >> sorry for blaming the library and wasting Your time. >> >> >> Grzegorz Krug?y pisze: >>> Hi Trent, >>> >>> Thanks for replying :) >>> >>> I tried SimpleWrite from Sun >>> (http://java.sun.com/developer/releases/javacomm/SimpleWrite.java) >>> which uses 9600 baudrate, 8 databits, 1 stopbit, none parity. The >>> only change I did to the linked code is changing String defaultPort >>> in line 64 to "COM5". >>> >>> Is it possible to turn on some logging in the dll or perhaps >>> download its debug version so I can see what happens inside? From >>> java debugger I can see that it calls native writeByte method which >>> never returns. >>> >>> >>> >>> Trent Jarvi pisze: >>>> >>>> >>>> On Thu, 4 Jun 2009, Grzegorz Krug?y wrote: >>>> >>>>> This is driving me crazy so maybe someone can help :-( >>>>> >>>>> I've used RxTx in numerous projects and out of the sudden it >>>>> stopped working on Windows. I've tried 2.1.7, 2.1.7r2, 2.2pre2 >>>>> (which has mismatching pre1/pre2 native/jar packend into bins zip) >>>>> and even Cloudhopper's 2.2 build and they all give me the same >>>>> result: >>>>> >>>>> I can open the port. >>>>> I can read from the port no problem. >>>>> When I try to write, the rxtx's writeByte native method (yes, I've >>>>> installed the java source code and debugged as far as that) >>>>> doesn't send anything and it doesn't even return - it just locks >>>>> up indefinitely. >>>>> >>>>> I get this on XP SP3 on my laptop, on XP SP3 in a Virtual Box and >>>>> on Vista SP1. I'm using Prolific USB-Serial adapter and my >>>>> customer gets this with built in COM port on XP SP2. >>>>> >>>>> On Linux everything is fine. >>>>> >>>>> Even >>>>> http://java.sun.com/developer/releases/javacomm/SimpleWrite.java >>>>> fails for me. >>>>> >>>>> Please tell me, what I can do? The RxTx never gave me any trouble >>>>> before. >>>>> >>>> >>>> >>>> Hi Grzegorz >>>> >>>> Do you have some simple reproduction code? Perhaps opening the >>>> port with the same settings and calling write? >>>> >>>> Is hardware flow control involved? >>>> >>>> -- >>>> Trent Jarvi >>>> tjarvi at qbang.org >>> >>> _______________________________________________ >>> Rxtx mailing list >>> Rxtx at qbang.org >>> http://mailman.qbang.org/mailman/listinfo/rxtx >>> >> >> _______________________________________________ >> Rxtx mailing list >> Rxtx at qbang.org >> http://mailman.qbang.org/mailman/listinfo/rxtx >> From rxtx at qbang.org Sat Jun 6 04:17:28 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Sat, 6 Jun 2009 07:17:28 -0300 Subject: [Rxtx] Pharmacy Online Sale 82% OFF! Message-ID: <20090606041728.2761.qmail@dmx1.bfi0.com> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From ralphs_email at gmx.de Wed Jun 10 03:27:10 2009 From: ralphs_email at gmx.de (Ralph H.M.) Date: Wed, 10 Jun 2009 11:27:10 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 Message-ID: Hello, there seems to be a version mismatch in the bin version of 2.2pre2. In the RXTXVersion.class in RXTXComm.jar it states "RXTX-2.2pre1" but it should "RXTX-2.2pre2". If you try to run the code you get an error because dll version and jar version doesn't match. In the source the version is stated correctly. Ralph -------------- next part -------------- An HTML attachment was scrubbed... URL: From gk at karko.net Wed Jun 10 03:31:09 2009 From: gk at karko.net (=?UTF-8?B?R3J6ZWdvcnogS3J1Z8WCeQ==?=) Date: Wed, 10 Jun 2009 11:31:09 +0200 Subject: [Rxtx] Version mismatch in bin 2.2pre2 In-Reply-To: References: Message-ID: <4A2F7D5D.9090708@karko.net> I can confirm this bug. It's probably just a packaging mistake. Ralph H.M. pisze: > > Hello, > > there seems to be a version mismatch in the bin version of 2.2pre2. In > the RXTXVersion.class in RXTXComm.jar it states ?RXTX-2.2pre1? but it > should ?RXTX-2.2pre2?. If you try to run the code you get an error > because dll version and jar version doesn?t match. In the source the > version is stated correctly. > > > > Ralph > > ------------------------------------------------------------------------ > > _______________________________________________ > Rxtx mailing list > Rxtx at qbang.org > http://mailman.qbang.org/mailman/listinfo/rxtx > From l.fu at pengutronix.de Wed Jun 10 05:10:58 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 13:10:58 +0200 Subject: [Rxtx] [PATCH] fix query for AC_ARG_ENABLE Message-ID: <1244632258-15229-1-git-send-email-l.fu@pengutronix.de> enable-lockfiles is add by AC_ARG_ENABLE, hence we have to query $enable_lockfiles instead of $lockfiles. Signed-off-by: Luotao Fu --- configure.in | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/configure.in b/configure.in index 00b592b..f2ac86b 100644 --- a/configure.in +++ b/configure.in @@ -129,7 +129,7 @@ AC_ARG_ENABLE(PRINTER, AC_ARG_ENABLE(lockfiles, [ --disable-lockfiles disable lock files (experimental) [default=no]], - if test x$lockfiles = xyes; then + if test x$enable_lockfiles = xyes; then echo "Using lock files" else echo "Disabling lock files" -- 1.6.0.4 From l.fu at pengutronix.de Wed Jun 10 11:24:28 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Wed, 10 Jun 2009 19:24:28 +0200 Subject: [Rxtx] Trouble with rxtx and jni interface in classpath Message-ID: <20090610172428.GB14217@pengutronix.de> Hi folks, I'm trying to use a crosscompiled rxtx on an ARM platform together with classpath and jamvm. jamvm is working well for itelf. However I get exception during initialisation with the nativeGetVersion call out of RXTXVersion object. Seems to me that the jni call is not working here. Here is the commandline I use to test rxtx. jamvm -verbose:jni -classpath /usr/share/jamvm/classes.zip:/usr/share/classpath/glibj.zip:.:/usr/share/java/RXTXcomm.jar SerTest SerTest is a piece of example test code I grabbed somewhere in the net, which simply calls getPortIdentifiers() and list them all. I attached the code to this mail. The code runs well on my host, which is a debian unstable. On my target however it breaks up with a "java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver". I traced along the jni calls. Seems that the nativeGetVersion call cannot be found. Here's a part of the verbose messages by jamvm during the call: .... [Dynamic-linking native method java.io.VMFile.exists ... JNI] [Dynamic-linking native method java.io.VMFile.length ... JNI] [Dynamic-linking native method java.lang.VMClassLoader.defineClass ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathSize ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootClassPathResource ... internal] [Dynamic-linking native method java.lang.VMClassLoader.getBootPackage ... internal] [Dynamic-linking native method gnu.io.RXTXVersion.nativeGetVersion ... ] [Dynamic-linking native method gnu.io.RXTXCommDriver.nativeGetVersion ... ] [Dynamic-linking native method gnu.java.nio.VMChannel.write ... JNI] java.lang.UnsatisfiedLinkError: nativeGetVersion thrown while loading gnu.io.RXTXCommDriver java.lang.NoClassDefFoundError: gnu/io/RXTXCommDriver thrown while loading gnu.io.RXTXCommDriver [Dynamic-linking native method java.lang.VMRuntime.exit ... internal] As far as I can tell. The jni interface seems to be working, since e.g. java.io.VMFile.exists, which is implemented in classpath itself could be called without trouble. When it however comes to RXTX, jni failed to find the nativeGetVersion call, which is located in librxtxSerial.so According to strace the library fiel was loaded correctly priorly. I tried to grab a little around in the jni code of classpath, where I unfortunately could not find anything promising. I'd really apericate any hint on my trouble. Thx Luotao Fu -- Pengutronix e.K. | Dipl.-Ing. Luotao Fu | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 | -------------- next part -------------- A non-text attachment was scrubbed... Name: SerTest.java Type: text/x-java Size: 333 bytes Desc: not available URL: -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 197 bytes Desc: Digital signature URL: From l.fu at pengutronix.de Wed Jun 10 16:46:51 2009 From: l.fu at pengutronix.de (Luotao Fu) Date: Thu, 11 Jun 2009 00:46:51 +0200 Subject: [Rxtx] [PATCH] fix rxtx_path for crosscompile Message-ID: <1244674011-22201-1-git-send-email-l.fu@pengutronix.de> RXTX_PATH is guessed by configure script. If a. jdk version is unknown b. crosscompiling c. JAVA_HOME is set the RXTX_PATH won't be set, which leads to an empty -rpath and finally librxtxSerial fails to link impSerial.o object. This means that the whole thing would be badly broken since this way the jni would fail to find bunch of symbols during initialisation. This patch introduces a CROSS_RXTX_PATH environment variable. This is more a hack to make my crosscompiling envrionment work and doesn't fix all problems listed above. A better solution is highly welcome. Signed-off-by: Luotao Fu --- configure.in | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/configure.in b/configure.in index f2ac86b..c1d53ed 100644 --- a/configure.in +++ b/configure.in @@ -580,6 +580,7 @@ Linux) #echo ---------------------------- case $target_os in linux*) + RXTX_PATH=$CROSS_RXTX_PATH ;; beos*) TARGETLIB="\$(target_triplet)/librxtxSerial.la" -- 1.6.0.4 From tjarvi at qbang.org Tue Jun 16 18:23:30 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 16 Jun 2009 18:23:30 -0600 (MDT) Subject: [Rxtx] test disregard Message-ID: Verifying qbang.org survived upgrades. -- Trent Jarvi qbang.org From rxtx at qbang.org Thu Jun 18 20:26:04 2009 From: rxtx at qbang.org (VIAGRA Inc.) Date: Fri, 19 Jun 2009 11:26:04 +0900 Subject: [Rxtx] Pharmacy Online Sale 85% OFF! Message-ID: <20090619202604.2825.qmail@student08> An HTML attachment was scrubbed... URL: -------------- next part -------------- New from WebMD: Dear rxtx at qbang.org!. Sign-up today! You are subscribed as rxtx at qbang.org. View and manage your WebMD newsletter preferences. Subscribe to more newsletters. Change/update your email address. WebMD Privacy Policy WebMD Office of Privacy 1175 Peachtree Street, Suite 2400, Atlanta, GA 30361 ? 2009 WebMD, LLC. All rights reserved. From lfarkas at lfarkas.org Tue Jun 23 07:09:19 2009 From: lfarkas at lfarkas.org (Farkas Levente) Date: Tue, 23 Jun 2009 15:09:19 +0200 Subject: [Rxtx] version 2.2 Message-ID: <4A40D3FF.3070500@lfarkas.org> hi, is there any change in the near future for final 2.2? thanks. -- Levente "Si vis pacem para bellum!" From tjarvi at qbang.org Tue Jun 23 19:30:18 2009 From: tjarvi at qbang.org (Trent Jarvi) Date: Tue, 23 Jun 2009 19:30:18 -0600 (MDT) Subject: [Rxtx] version 2.2 In-Reply-To: <4A40D3FF.3070500@lfarkas.org> References: <4A40D3FF.3070500@lfarkas.org> Message-ID: On Tue, 23 Jun 2009, Farkas Levente wrote: > hi, > is there any change in the near future for final 2.2? > thanks. > Hi Farkas I hope to get it out prior to a trip on the 7th. -- Trent Jarvi tjarvi at qbang.org From Steffen.DETTMER at ingenico.com Tue Jun 2 03:21:29 2009 From: Steffen.DETTMER at ingenico.com (Steffen DETTMER) Date: Tue, 2 Jun 2009 11:21:29 +0200 Subject: [Rxtx] performance compromises In-Reply-To: <4A1D55D9.7040209@bbs.darktech.org> References: <4A1B724A.9000002@bbs.darktech.org> <20090526125639.GP18419@elberon.bln.de.ingenico.com> <4A1C0004.6030502@bbs.darktech.org> <20090527085204.GV18419@elberon.bln.de.ingenico.com> <4A1D1057.4000902@bbs.darktech.org> <20090527130622.GB18419@elberon.bln.de.ingenico.com> <4A1D55D9.7040209@bbs.darktech.org> Message-ID: <20090602092129.GJ18419@elberon.bln.de.ingenico.com> * cowwoc wrote on Wed, May 27, 2009 at 11:01 -0400: > Steffen DETTMER wrote: > > > or if the thread was interrupted, > > > > No, AFAIK, this leads to an exception (and probably an > > `undefined' state of bytes in the buffer). Beside, that this > > is more or less a `cannot happen situation' (because: how to > > interrrupt a thread which is in a blocking JNI