aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--src/core/net.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/net.c b/src/core/net.c
index 4d4b7344..376a57e2 100644
--- a/src/core/net.c
+++ b/src/core/net.c
@@ -547,7 +547,9 @@ JANET_CORE_FN(cfun_net_connect,
}
/* Wrap socket in abstract type JanetStream */
- JanetStream *stream = make_stream(sock, JANET_STREAM_READABLE | JANET_STREAM_WRITABLE);
+ uint32_t udp_flag = 0;
+ if (socktype == SOCK_DGRAM) udp_flag = JANET_STREAM_UDPSERVER;
+ JanetStream *stream = make_stream(sock, JANET_STREAM_READABLE | JANET_STREAM_WRITABLE | udp_flag);
/* Set up the socket for non-blocking IO before connecting */
janet_net_socknoblock(sock);