|
-
October 7th, 2010, 07:03 AM
#1
IO Handling Problem
Hi,
I'm in a big mess and kindly need your advices(and it's kind of urgent too)..
I have written a Named Pipe client in java where the Named Pipe server is in C++ and cannot be modified. In the client, i have used java's "RandomAccessFile" to create a bidirectional pipe to the server.
From another class a separate thread is continuously trying to read the Named Pipe Client where the main thread tries to write to the Named Pipe Client when required.
In the ideal situation i want the Named Pipe Client's read method to return -1 or null when there in no incoming stream from the server and sleep for 100ms (which will allow the main thread to perform write operations if required) and then go for the next iteration of listening. Or at-least implementing a timeout for the read function is required.
I can not change the server/client communication to sockets since server is already implemented in C++ and can not be altered.
Please give me a hit to solve this...
Thanks!
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|