mirror of
https://github.com/status-im/react-native-udp.git
synced 2025-02-17 11:16:26 +00:00
Set max buffer size to maximum allowed (#44)
* Set max buffer size to maximum allowed I'm evaluating this library for an application that sends ~60kb size UDP messages. Without this setting the messages are cut off at the default message size. This is probably something you'd want to set with `const socket = dgram.createSocket('udp4', { maxBufferSize: 'UINT16_MAX' })`. I've modified the library to automatically choose the largest allowed size `GCDAsyncUdpSocket` allows (which is 64kb). * Set max ipv6 buffer size to uint16 maximum
This commit is contained in:
parent
dc04cd35df
commit
69a8e844e3
@ -93,6 +93,10 @@ NSString *const RCTUDPErrorDomain = @"RCTUDPErrorDomain";
|
||||
_address = address;
|
||||
|
||||
_udpSocket = [[GCDAsyncUdpSocket alloc] initWithDelegate:self delegateQueue:[self methodQueue]];
|
||||
|
||||
[_udpSocket setMaxReceiveIPv4BufferSize:UINT16_MAX];
|
||||
[_udpSocket setMaxReceiveIPv6BufferSize:UINT16_MAX];
|
||||
|
||||
BOOL result;
|
||||
if (address) {
|
||||
struct sockaddr_in ip;
|
||||
|
Loading…
x
Reference in New Issue
Block a user