2009-10-31 1 views
0

Я попробовал пример http://www.rebol.net/docs/async-examples.html, но он не работает.rebol open не имеет уточнения async

port-spec: tcp://www.rebol.net:80 

http-request: {GET/
User-Agent: REBOL/Core 
Connection: close 

} 

client: context [ 
    data: make binary! 10000 
    handler: func [port action arg] [ 
     switch action [ 
      read [ 
       append data copy/part port arg 
       print ["-- read" arg "bytes" length? data "total"] 
      ] 
      write  [print "-- writing (sending)"] 
      write-done [print "-- done with write"] 
      close [ 
       print ["-- done with read" length? data] 
       close port 
       print ["-- closed port, press RETURN to quit"] 
      ] 
      init  [print "-- port initialized"] 
      open  [print "-- opened" insert port http-request] 
      address [print ["-- address lookup:" arg]] 
      error  [print ["-- error:" mold disarm :arg] close port] 
     ] 
    ] 
] 

p: open/direct/binary/async port-spec get in client 'handler 
input ; (wait for user console input before closing) 
attempt [close p] 

ответ

1

The/async был удален некогда. Если вы хотите использовать async, вам придется использовать асинхронные протоколы Gabriele и других.

 Смежные вопросы

  • Нет связанных вопросов^_^