0

I have a setup where one program reads from a named pipe and writes the read data to a socket. Another program reads from the socket and writes the data to another named pipe. This is on Linux across nodes. It all works fine doing regular reads and writes on Java FileChannels but when I tried to be more efficient and used transferTo to send the named pipe data out on a socket channel the transferTo always comes back with 0 bytes transferred. Receiving the data transferFrom is more decisive: It gets an exception trying to do a seek on the named pipe (seeks are not allowed on named pipes). Am I trying to do the impossible? Has anyone had luck using transferTo and/or transferFrom with named pipes.

Thanks.

user1922871
  • 103
  • 6
  • Clearly not. Unless you are shifting many megaabytes you would be unlikely to see much difference anyway. – user207421 Jan 16 '13 at 02:28
  • Clearly not possible? I am shifting gigabytes of data. – user1922871 Jan 16 '13 at 02:49
  • Clearly not possible because you are getting zero return values, which indicates that zero bytes were shifted, which indicates that the operation is not possible. Or else you have withheld some important information: such as, the channel is in non-blocking mode? – user207421 Jan 18 '13 at 04:46

0 Answers0