uNetworking / uNetworking/uSockets
udp_benchmark can work on mac os
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 1.5k
- Forks
- 307
- PR merge metrics
- No merged PRs in 30d
Description
I am using mac 12.7.6, after make examples, udp_benchmark cant work,
line 143: int sent = us_udp_socket_send(client, send_buf, 40);
return -1, the error code is 'Message is too long'
in bsd.c bsd_sendmmsg() the macro
#if defined(APPLE) seems wrong , i changed to #if 0 and changed line 81 to : #elif defined(_WIN32) || defined(APPLE), it works.
struct us_internal_udp_packet_buffer:
struct us_internal_udp_packet_buffer {
#if defined(_WIN32) || defined(APPLE)
char *buf[LIBUS_UDP_MAX_NUM];
size_t len[LIBUS_UDP_MAX_NUM];
struct sockaddr_storage addr[LIBUS_UDP_MAX_NUM];
#else
struct mmsghdr msgvec[LIBUS_UDP_MAX_NUM];
struct iovec iov[LIBUS_UDP_MAX_NUM];
struct sockaddr_storage addr[LIBUS_UDP_MAX_NUM];
char control[LIBUS_UDP_MAX_NUM][256];
#endif
};
for mac, should not use sendmsg
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in bsd.c, especially bsd_sendmmsg() and the us_internal_udp_packet_buffer definitions, then reproduce the failure with examples/udp_benchmark on macOS. Compare the APPLE and _WIN32 paths and verify that the benchmark sends successfully without the “Message is too long” error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 68/100