据我了解源代码,网络设备已经准备好了UDP,但如何制作UDP方案?
答案 0 :(得分:0)
在源https://github.com/rebol/r3/blob/master/src/core/c-port.c#L612的这一行中,评论说
In order to add a port scheme:
In mezz-ports.r add a make-scheme.
Add an Init_*_Scheme() here.
Be sure host-devices.c has the device enabled.
我认为第一条指令是指mezz / sys-ports.r。所以,我们有这个例子https://github.com/rebol/r3/blob/master/src/mezz/sys-ports.r#L254,我们可以添加类似
的内容make-scheme [
title: "UDP Networking"
name: 'udp
spec: system/standard/port-spec-net
info: system/standard/net-info ; for C enums
awake: func [event] [print ['UDP-event event/type] true]
]
然后你必须为TCP https://github.com/rebol/r3/blob/master/src/core/p-net.c#L299写一个像这样的INIT_UDP_SCHEME,其中TCP_Actor从这里开始https://github.com/rebol/r3/blob/master/src/core/p-net.c#L92,然后在这里初始化它https://github.com/rebol/r3/blob/master/src/core/c-port.c#L626
正如你所说,UDP似乎已经准备就绪。