rebol open 没有称为异步的细化
我尝试了示例 http://www.rebol.net/docs/async-examples。 html 但它不起作用。
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]
I tried the example http://www.rebol.net/docs/async-examples.html but it doesn't work.
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]
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
/async 不久前已被删除。如果您想使用异步,则必须使用 Gabriele 和其他人的异步协议。
The /async was removed a while ago. If you want to use async, you'll have to use Gabriele and others' async protocols.