Hello,
Actually it's socket reading code.. there is more to read when gpsd reads it.
xgps uses actually ?WATCH={"enable":true,"json":true} that makes gpsd to send you GPS fix as soons as possible. Sometimes that is needed option.
Perl version uses ?POLL that is very handy if you want to have GPS fix when your application neededs it without push. Unhandy this one comes because of ?POLL; implementation in gpsd.
You need to be subriber (on doable via ?WATCH) to that device and after that you get fixes pushed to you. There is need to be fixed that ?POLL; asumes also if ?WATCH; is not called that user wants first devices fix. It's wrong but it's not that wrong because users are happier?
Thanks,
Tuukka