Maybe you don't need the low level socket stuff, if you could use the Client/Server (Simple Socket). Look for jsss and jssc in Find in Files (All). Otherwise...
sdasync only notifies you when the data arrives. The issue of reading all the data before proceeding is a separate one. You should know the criteria that all data arrived, and they must be met before proceeding. So it should not matter what you use: sdselect or sdasync. However, I do not imagine that sdasync is feasible, except for a GUI application AND in order to listen to incomming connections as opposed to making requests. The two models of listening and requesting applications respectively can be found in "HTTP Get" and "Pump" scripts, both used in practical settings. http://www.jsoftware.com/jwiki/Scripts/Pump http://www.jsoftware.com/jwiki/Scripts/HTTP_Get --- Yuvaraj Athur Raghuvir <[EMAIL PROTECTED]> wrote: > Hello Bill, > > Polling what? All I know is that when the socket "wakes up" the > socket_handler is invoked. Is there any specific api/callback I should use > so that when the socket wakes up, I can continue with the execution? > > Alternatively, can I "wait" on an event that gets set in the socket_handler > and allows the verb to sleep until that event happens? > > Regards, > Yuva > > > On Dec 21, 2007 4:09 PM, bill lam <[EMAIL PROTECTED]> wrote: > > > I might misread your question, but I believe that you can do it by polling > > until > > all expected data arrived before executing the next statement. > > > > Yuvaraj Athur Raghuvir wrote: > > > Hello, > > > > > > a) I have a socket_handler associated with a async socket > > > b) I have a test verb that performs a series of communication calls - > > sends > > > data, receives data, and decides on the next step based on data > > returned. > > > c) The problem I face is that the execution of the next statement in the > > > verb occurs before the data in the socket is read. > > > > > > Q: How to synchronize verb execution with socket communication when I > > use > > > async mode on socket? > > > > > > Regards, > > > Yuva > > > > > > > > > > > > > > > On Dec 21, 2007 7:42 AM, Roger Hui <[EMAIL PROTECTED]> wrote: > > > > > >> For example: > > >> > > >> perm2=: 3 : 0 > > >> z=. i.1 0 > > >> for. i.y do. z=. ,/ (0,.1+z) {"2 1 \:"1 = i. 1+{:$z end. > > >> ) > > >> t=: 5!:5 <'perm2' > > >> t > > >> 3 : 0 > > >> z=. i.1 0 > > >> for. i.y do. z=. ,/ (0,.1+z) {"2 1 \:"1 = i. 1+{:$z end. > > >> ) > > >> 0!:0 'perm3=:',t > > >> perm3 > > >> 3 : 0 > > >> z=. i.1 0 > > >> for. i.y do. z=. ,/ (0,.1+z) {"2 1 \:"1 = i. 1+{:$z end. > > >> ) > > >> > > >> > > >> > > >> ----- Original Message ----- > > >> From: Yuvaraj Athur Raghuvir <[EMAIL PROTECTED]> > > >> Date: Thursday, December 20, 2007 17:53 > > >> Subject: [Jprogramming] Recovering a multi-line verb from a string > > >> To: Programming forum <[email protected]> > > >> > > >>> Hello, > > >>> > > >>> I can use (5!:5) to get a string representation of a verb. If > > >>> the verb is > > >>> multiline, my attempts to use do (".) to recover the verb fails > > >>> with a > > >>> syntax error > > >>> > > >>> How to do it right? > > >>> > > >>> Regards, > > >>> Yuva > > >>> > > >>> p.s: I am sending the verb as a string via a socket connection. > > >>> This way I > > >>> want to pass the verbs from the client to the server and then > > >>> invoke it > > >>> remotely. > > >> ---------------------------------------------------------------------- > > >> For information about J forums see http://www.jsoftware.com/forums.htm > > >> > > > ---------------------------------------------------------------------- > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > > > > > > -- > > regards, > > bill > > ---------------------------------------------------------------------- > > For information about J forums see http://www.jsoftware.com/forums.htm > > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ____________________________________________________________________________________ Looking for last minute shopping deals? Find them fast with Yahoo! Search. http://tools.search.yahoo.com/newsearch/category.php?category=shopping ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
