|
@@ -1962,6 +1962,13 @@ module StdSocket = struct
|
|
vnull
|
|
vnull
|
|
)
|
|
)
|
|
|
|
|
|
|
|
+ let setBroadcast = vifun1 (fun vthis b ->
|
|
|
|
+ let this = this vthis in
|
|
|
|
+ let b = decode_bool b in
|
|
|
|
+ setsockopt this SO_BROADCAST b;
|
|
|
|
+ vnull
|
|
|
|
+ )
|
|
|
|
+
|
|
let setTimeout = vifun1 (fun vthis timeout ->
|
|
let setTimeout = vifun1 (fun vthis timeout ->
|
|
let this = this vthis in
|
|
let this = this vthis in
|
|
let timeout = match timeout with VNull -> 0. | VInt32 i -> Int32.to_float i | VFloat f -> f | _ -> unexpected_value timeout "number" in
|
|
let timeout = match timeout with VNull -> 0. | VInt32 i -> Int32.to_float i | VFloat f -> f | _ -> unexpected_value timeout "number" in
|
|
@@ -3298,6 +3305,7 @@ let init_standard_library builtins =
|
|
"send",StdSocket.send;
|
|
"send",StdSocket.send;
|
|
"sendChar",StdSocket.sendChar;
|
|
"sendChar",StdSocket.sendChar;
|
|
"setFastSend",StdSocket.setFastSend;
|
|
"setFastSend",StdSocket.setFastSend;
|
|
|
|
+ "setBroadcast", StdSocket.setBroadcast;
|
|
"setTimeout",StdSocket.setTimeout;
|
|
"setTimeout",StdSocket.setTimeout;
|
|
"shutdown",StdSocket.shutdown;
|
|
"shutdown",StdSocket.shutdown;
|
|
];
|
|
];
|