c - How can I get an error stream over a socket in Java? -
i'm writing work around java bug:
http://bugs.sun.com/view_bug.do?bug_id=5049299
basically, i've got light weight c server runs on same machine java server. i'm adding feature c server when can request fork/run new process via socket , pass stdin/stdout/stderr. on java side, i've created mimics behavior of processbuilder
, runtime.exec()
, on socket.
the problem arises stderr
. java sockets don't have error stream, i'm @ bit of loss how over. i've come 2 potential solutions:
- create second socket (probably c server java server) in send stderr over.
- interleave output of process stderr of process , parse them apart in java separate streams
both solutions have inherent problems, i'd love hear feedback has.
bonus: give me easy, guaranteed solution java bug doesn't involve me doing of , i'll best friend forever.
to solve this, took advantage of fact 2 servers running on same machine. merely wrote stderr file read in other server. not elegant solution in world, quite simple , works.
Comments
Post a Comment