2013-03-29 37 views

回答

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. 

我認爲第一個指令是指夾層卡/ 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看起來似乎準備就緒。

+0

感謝格雷厄姆,網設備必須切換到UDP第一次看到REB-net.h socket_types,但主要的問題是,如果演員將是相同TCP或完全不同的 – user2223887

+0

UDP現在已經實現 –

相關問題