File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Stuck with readline and acknowledgement processing. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Bookmark "Stuck with readline and acknowledgement processing." Watch "Stuck with readline and acknowledgement processing." New topic
Author

Stuck with readline and acknowledgement processing.

sukbir frwa
Greenhorn

Joined: May 12, 2011
Posts: 14
Dear All,
Below is my codes. Currently the codes gets data from gps devices. The problem now if you notice is that I have to send twice the acknowledgement message that is w.write("$PA\n"); w.flush(); once in line 56 and 57 and once more in 85 and 86 then only I will receive all the 5 strings. Currently my method of receving is the one I have commented out that is from 62 to 128. I notice that if I dont know send the second acknowledgement I only receive the single string but it suppose to be 5 strings. So I am trying to revert to readline method at line 58 but unfortunately it always wait for \n rather than null. Any help.

Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19654
    
  18

Could you please indent your code properly next time? It was almost impossible to read it without it. I've added some this time.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
sukbir frwa
Greenhorn

Joined: May 12, 2011
Posts: 14
Dear Rob,
Sorry for the formatting and indent. Thank you.
Rob Spoor wrote:Could you please indent your code properly next time? It was almost impossible to read it without it. I've added some this time.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Stuck with readline and acknowledgement processing.
 
Similar Threads
Date function
DateFormatting
How to get tomorrow's date?
problem in connecting floggy using j2me
passing Date through Select query .