summaryrefslogtreecommitdiff
path: root/thirdparty/enet
diff options
context:
space:
mode:
Diffstat (limited to 'thirdparty/enet')
-rw-r--r--thirdparty/enet/godot.cpp40
1 files changed, 40 insertions, 0 deletions
diff --git a/thirdparty/enet/godot.cpp b/thirdparty/enet/godot.cpp
index 2e1519b7b2..894061a20f 100644
--- a/thirdparty/enet/godot.cpp
+++ b/thirdparty/enet/godot.cpp
@@ -216,6 +216,46 @@ int enet_socket_listen(ENetSocket socket, int backlog) {
int enet_socket_set_option(ENetSocket socket, ENetSocketOption option, int value) {
+ NetSocket *sock = (NetSocket *)socket;
+
+ switch (option) {
+ case ENET_SOCKOPT_NONBLOCK: {
+ sock->set_blocking_enabled(value ? false : true);
+ return 0;
+ } break;
+
+ case ENET_SOCKOPT_BROADCAST: {
+ sock->set_broadcasting_enabled(value ? true : false);
+ return 0;
+ } break;
+
+ case ENET_SOCKOPT_REUSEADDR: {
+ sock->set_reuse_address_enabled(value ? true : false);
+ return 0;
+ } break;
+
+ case ENET_SOCKOPT_RCVBUF: {
+ return -1;
+ } break;
+
+ case ENET_SOCKOPT_SNDBUF: {
+ return -1;
+ } break;
+
+ case ENET_SOCKOPT_RCVTIMEO: {
+ return -1;
+ } break;
+
+ case ENET_SOCKOPT_SNDTIMEO: {
+ return -1;
+ } break;
+
+ case ENET_SOCKOPT_NODELAY: {
+ sock->set_tcp_no_delay_enabled(value ? true : false);
+ return 0;
+ } break;
+ }
+
return -1;
}