epoch1970;591518 Wrote: > > Code: -------------------- > > m...@montreux:~$echo 'players' | nc -w1 127.0.0.1 9090 > players count%3A4 > m...@montreux:~$echo 'rescan' | nc -w1 127.0.0.1 9090 > rescan > m...@montreux:~$echo 'serverstatus' | nc -w1 127.0.0.1 9090 > serverstatus rescan%3A1 progressname%3AMerge%20Various%20Artists progressdone%3A701 progresstotal%3A2139 version%3A7.4.2 uuid%3A0ec8f46a-14b2-4fa7-9233-c1bb5c6d26e4 info%20total%20albums%3A2361 info%20total%20artists%3A998 info%20total%20genres%3A55 info%20total%20songs%3A16448 player%20count%3A4 sn%20player%20count%3A0 other%20player%20count%3A0 > m...@montreux:~$ -------------------- > > > Looks like nc returns stuff on my (linux) machine running SC 7.4.2. > > Maybe you want to do stuff with "unix sockets" to do local-only > communication, rather than using pipes ? I think the code I posted a > long while ago to do some power management under the mac (a daemon > launched as root and a userland script launched by srvPowerControl) > was communicating over a unix socket. > I'm sure O'Reilly has all the info you'd ever need, in its Perl or > Unix series. Right here is an illegitimate link to the Perl Cookbook > on unix sockets, nasty ads included: > http://docstore.mik.ua/orelly/perl/cookbook/ch17_01.htm > > EDIT: *On the mac, make sure 'localhost' resolves to 127.0.0.1...* Yeah...I don't know why, but on my Fedora 12 box running SBS 7.6 from the svn code, this:
# echo 'players' | nc -w1 127.0.0.1 9090 ..produces no output. But this: # nc -w1 127.0.0.1 9090 <<EOF players exit EOF # ..produces: players count%3A2 I'm mystified. -- gharris999 ------------------------------------------------------------------------ gharris999's Profile: http://forums.slimdevices.com/member.php?userid=115 View this thread: http://forums.slimdevices.com/showthread.php?t=83539 _______________________________________________ unix mailing list [email protected] http://lists.slimdevices.com/mailman/listinfo/unix
