×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Hi Scott

Thanks for your reply and your excellent tutorial.


On 18 September 2013 23:00, Scott Klement <rpg400-l@xxxxxxxxxxxxxxxx> wrote:

1) I would strongly recommend using non-blocking sockets in your
example. These do not wait, but return immediately if there's no data
to read.


I tried using these, but could not get them to work at all, they just
returned nothing all the time.



2) The select() or poll() API (personally, I always use selecT()) can be
used to check if there's data available to read on a socket, or to wait
for data (even on a non-blocking socket) with a timeout.


Poll seems to be working better for me. Why should I not use readln, the
device I am talking to it only ever returns strings ending with a newline
no more than 50 chars long (it's a scale and not that bright).



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.