Reduce the number of buffers per socket. Reduce the size of the TCP buffers and make them a fixed size.

main
Nichole Mattera 4 years ago
parent 1691a105fe
commit dad03c1cf6
  1. 15
      source/main.c

@ -29,8 +29,8 @@
#include <limits.h>
#define INNER_HEAP_SIZE 0x46D100
#define MAX_LINE_LENGTH 25
#define SOCK_BUFFERSIZE 16384
#define MAX_LINE_LENGTH 26
#define SOCK_BUFFERSIZE 256
u32 __nx_applet_type = AppletType_None;
@ -59,19 +59,18 @@ void __appInit(void) {
if (R_FAILED(rc))
fatalSimple(MAKERESULT(Module_Libnx, LibnxError_InitFail_HID));
// Copied from sys-ftpd.
static const SocketInitConfig socketInitConfig = {
.bsdsockets_version = 1,
.tcp_tx_buf_size = 8 * SOCK_BUFFERSIZE,
.tcp_rx_buf_size = 8 * SOCK_BUFFERSIZE,
.tcp_tx_buf_max_size = 16 * SOCK_BUFFERSIZE,
.tcp_rx_buf_max_size = 16 * SOCK_BUFFERSIZE,
.tcp_tx_buf_size = 1024,
.tcp_rx_buf_size = 256,
.tcp_tx_buf_max_size = 0,
.tcp_rx_buf_max_size = 0,
.udp_tx_buf_size = 0x2400,
.udp_rx_buf_size = 0xA500,
.sb_efficiency = 8,
.sb_efficiency = 2,
};
rc = socketInitialize(&socketInitConfig);

Loading…
Cancel
Save