1
0
mirror of https://github.com/janet-lang/janet synced 2025-11-10 20:43:05 +00:00

Merge pull request #1621 from tttuuu888/work-issue-1620

Fix: Correctly flag UDP streams in net/connect #1620
This commit is contained in:
Calvin Rose
2025-08-12 16:04:52 -05:00
committed by GitHub

View File

@@ -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);