0

I've a simple xINETd UDP service written in PHP - basicly acting as a proxy -, but when I try to write back the answer with fwrite(STDOUT, $ans); I'm getting an interesting error:

PHP Notice:  fwrite(): send of 244 bytes failed with errno=89 Destination address required in ...

Since it's xinetd, which makes the socket and binds it to PHP stdin/stdout I'm lost about the issue. (simple 'echo' gives no error message, but no response packet is sent back either)

V1pr
  • 103
  • 2
  • 9

1 Answers1

0

xinetd "feature" :( when working with UDP, than you must treat stdin/stdout as a socket (and use getpeername() on it) to be able to respond... you'll have to set up the responding socket based on the input data (with UDP - with TCP it'll probably work with a simple 'echo')

V1pr
  • 103
  • 2
  • 9