Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

using awake?

 [1/2] from: nitsch-lists::netcologne::de at: 15-Jun-2002 14:18


Hi all, i need a tcp-handler which is started/stopped by a button. now there is already a do-events running, an own wait is bad. so i want to use port/awake to process a tcp-request and respond a result=2E and not to stop the do-events. would this work, and how do i use 'awake? greetings Volker

 [2/2] from: g:santilli:tiscalinet:it at: 15-Jun-2002 15:22


Hi Volker, On Saturday, June 15, 2002, 2:18:39 PM, you wrote: VN> so i want to use port/awake to process a tcp-request and respond a result. VN> and not to stop the do-events. VN> would this work, and how do i use 'awake? Yes, it will. You need to add your port to system/ports/wait-list so that it is waited for by DO-EVENTS. Then, you need to write an handler: port/awake: func [port /local data] [ ; there's something in port ; with no-wait you could: while [not empty? data: copy port] [prin data] ; you should return TRUE or FALSE ; TRUE: the WAIT function should return ; FALSE: continue waiting false ] This is almost all. Regards, Gabriele. -- Gabriele Santilli <[g--santilli--tiscalinet--it]> -- REBOL Programmer Amigan -- AGI L'Aquila -- REB: http://web.tiscali.it/rebol/index.r