- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个具有多个 IP 的 Windows 设置,并希望我的 Rebol 脚本(在 Rebol/Core 2.78 上)能够单独绑定(bind)并监听每个 IP 上的相同端口号。
直到最近,我认为这样做的语法是:
Port1Test: open/lines tcp://:80 browse http://10.100.44.6?
Port2Test: open/lines tcp://:80 browse http://10.100.44.7?
Port2Test
行失败,因为
browse http://10.100.44.6?
部分被完全忽略(现在搜索,我什至无法找到我首先获得该语法的位置)。
Port1Test: open/lines tcp://:80
Port1Test
端口显示大多数设置为
none
,还有一些设置如下:
scheme: 'tcp
host: none
port-id: 80
local-ip: 0.0.0.0
local-port: 80
Port1Test: open/lines tcp://:80 ; Create port, as before. Then modify below
Port1Test/host: 10.100.44.6 ; Might this be the binding interface?
Port1Test/port-id: 1 ; I guess this is just an id?
Port1Test/local-ip: 10.100.44.6 ; This ought to be the binding interface.
Port2Test: open/lines tcp://:80 ; Create port, as before. Then modify below
Port2Test/host: 10.100.44.7 ; Might this be the binding interface?
Port2Test/port-id: 2 ; I guess this is just an id?
Port2Test/local-ip: 10.100.44.7 ; This ought to be the binding interface.
Port1Test
和
Port2Test
, 创建时失败
Port2Test
. :-(
最佳答案
Rebol2 监听端口默认绑定(bind)到所有可用的 IPv4 接口(interface)(0.0.0.0),不幸的是,据我所知,没有办法改变它。
仅供引用,Rebol2 使用 interfaces
公开现有的 IPv4 接口(interface)端口模式:
>> p: open tcp://:8000
>> probe get-modes p 'interfaces
[make object! [
name: "if19"
addr: 10.27.10.110
netmask: 255.255.255.252
broadcast: 10.27.10.111
dest-addr: none
flags: [broadcast multicast]
] make object! [
name: "lo0"
addr: 127.0.0.1
netmask: 255.0.0.0
broadcast: none
dest-addr: none
flags: [multicast loopback]
] make object! [
name: "if16"
addr: 192.168.1.4
netmask: 255.255.255.0
broadcast: 192.168.1.255
dest-addr: none
flags: [broadcast multicast]
]]
关于Rebol 2 端口绑定(bind)到多个 IP,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34779063/
我知道你可以输入声明参数并返回函数 some-func: function [ "some func" number [ integer! ] ] [ resul
我在 REBOL3 REPL 中遇到的一个烦人的问题是它不接受多行语句。例如,我想输入 "some_obj: make obj! [",按回车键,然后继续该语句。 这对我来说很重要,因为我使用 Vim
我尝试使用 find函数检查字符串 "ll" 的出现在字符串中 "hello" ,但它返回 "ll"而不是 true或 false : "This prints 'll'" print find "h
我创造了这个 cloneset: :set set: func[word [word!] value][ if/else (type? get word) = list! [ print "l
我还没有弄清楚如何以更简洁的方式拆分字符串。 ref: copy/part (find line "#") -15 rest2: copy/part (skip (find line "#") 1
这适用于外壳级别: >> a: "hello" == "hello" >> get to-lit-word "a" == "hello" 但是在这样的函数中: f: func [ arg1 ] [
想象一下下面的 REBOL 代码: foo: 上下文 [bar: 3] 我现在有一个上下文 foo其中'bar被定义为。我怎样才能在这个上下文中动态地注入(inject)一个新词?是否可以? 我试过了
我们可以通过 input 从控制台获取输入或 ask ,表示按键盘上的某些键并按“Enter”键终止输入。 我想知道是否有一种方法可以获得按键输入,也就是说,只需按下键盘上的一个键,然后就会发生一些事
鉴于您可以将函数的参数限制为特定数据类型,因此您可能想要定义自己的数据类型是合情合理的,但我在 Rebol 文档中看不到任何内容表明这是该语言的一个特性(除非我没有)看起来很好)。 我期望的是能够执行
我正在我的脚本中连接到多台服务器,目前如果其中一台发生故障,我会收到 ** Access Error: Network timeout错误,脚本停止。我宁愿能够发现并继续前进,而不是让它完全放弃。 有
在 R2 和 R3 中,我可以使用 unique从系列中删除重复项: >> a: [1 2 2 3] >> length? a == 4 >> length? unique a == 3 如何对一系列
有没有办法避免这个问题? 最佳答案 这是 Rebol v2.x 网络协议(protocol)中的一个错误。这是一个有效的网址!类型。通常,你可以这样做: >> type? http://user:pa
可以覆盖 rebol 系统单词,如 print、make 等,那么是否可以对路径运算符执行相同的操作?那么语法是什么? 最佳答案 另一种可能的方法是使用 REBOL 元编程功能并预处理您自己的代码以捕
在另一个问题中,我看到了以下语法: #[未设置!] 那是什么?如果我说 type? #[unset!] 在 R3 中,它告诉我 unset!,但它并没有解开 #[] 是什么的谜团。 很好奇。 最佳答案
我想要这样的东西: >> op : infix-func [self x] [ 2 * x + self ] >> 3 op 2 == 7 有可能吗? 最佳答案 目前不可能,不。您可以将现有运算符分配
我知道,我知道。 “什么换行状态?”,你问。好吧,让我告诉你: append [] w: first new-line [hello] on == [ hello ] W 现在是一个词,在附加
我试图在 REBOL 编程语言中将函数作为参数传递,但我还没有找到正确的语法: doSomething: func [a b] [ a b a b ] doSomething prin
我正在执行一些代码,然后等待 1 秒到 1 分钟。我目前正在使用 random 0:01:00/seed,但我真正需要的是能够设置一个楼层,使其等待 30 秒到 1 分钟。 最佳答案 如果您希望 0:
新手问题在这里... 我想将“what”函数的输出写入文本文件。 所以这就是我所做的: 我创建了一个名为“text”的变量并将“what”的输出分配给它 文字:[什么] 现在我想将“text”变量的内
为了逐行读取文本文件,而不将整个文件加载到内存中,在 Rebol 中这样做的常用方法是什么? 我正在执行以下操作,但我认为(如果我错了,请纠正我)它首先将整个文件加载到内存中: foreach lin
我是一名优秀的程序员,十分优秀!