Just to clarify:
What you are saying is that you don't need a "background" process to block
and post a message to the forground app when data comes in?  So in the
application's event loop you would actually block on this call to wait for
an event.  Hmmm.  I wonder if there could be some event that occurs that
would not trigger the NetLibSelect() function, requiring you to set a
timeout so that you could check the "real" event log periodically.  Then you
have to carefully choose the timeout, too, to both keep the app responsive
and yet not race the CPU.  

I would say that if this call can be triggered by all events your
application is interested in, then it should satisfy the requirements.  If
not, the background process, while cumbersome, may be the best solution
still.

I'd have to try some things to know for sure.  Thanks for the suggestion.

-----Original Message-----
From: David Tribble [mailto:[EMAIL PROTECTED]]
Sent: Thursday, February 10, 2000 8:22 PM
To: Palm Developer Forum
Subject: RE: Sockets and Events


You may find that NetLibSelect does what you want if you put it in your
event loop.  From the Palm OS SDK Reference (Preliminary modified 1/7/00):

NetLibSelect:
Purpose: Blocks until I/O is ready on one or more descriptors, where a
descriptor can represent socket input, socket output, or a user input event
like a pen tap or key press.

trib
--------------------------------------------------
David Tribble, INRI Hawaii
(808) 625 2118 (v)  (808) 625 6315 (f)

-----Original Message-----
From:   Biales, Brian [SMTP:[EMAIL PROTECTED]]

Peter,
I've not started coding yet, but I had the same question.

-----Original Message-----
From: Ford, Peter [mailto:[EMAIL PROTECTED]]

I'm in the process of building an app which connects to one of our Unix
servers using a socket. It works pretty well but there's a problem. The
client (that is, the app running on the Palm) may be waiting for an event
which could be, say, a button press. However, the server may produce a
packet at any time, and my program needs to be able to respond quickly.

Now ideally, since the whole programming model for the Palm is based around
event-driven programs, I want to be able to have an event fired when data
arrives from the socket. That way my app can handle incoming packets when
they appear. The way things are right now, all I can do is periodically
check the socket to see if anything has come in.

Does anyone know: are there any network events my program can listen for? Do
I need to hack the OS to make this work?


-- 
For information on using the Palm Developer Forums, or to unsubscribe,
please see http://www.palm.com/devzone/mailinglists.html

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to