1
据我了解源代码,net设备已经准备好了UDP,但是如何制作UDP方案呢?如何在Rebol3中实现UDP方案
据我了解源代码,net设备已经准备好了UDP,但是如何制作UDP方案呢?如何在Rebol3中实现UDP方案
在此行的源代码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.
我认为第一个指令是指夹层卡/ 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其中TCP_Actor从这里开始https://github.com/rebol/r3/blob/master/src/core/p-net.c#L92的INIT_UDP_SCHEME,然后初始化在这里https://github.com/rebol/r3/blob/master/src/core/c-port.c#L626
正如你所说,UDP看起来似乎准备就绪。
感谢格雷厄姆,网设备必须切换到UDP第一次看到REB-net.h socket_types,但主要的问题是,如果演员将是相同TCP或完全不同的 – user2223887
UDP现在已经实现 –