Skip to content

Commit

Permalink
Adjusted the size of UDP receive buffer
Browse files Browse the repository at this point in the history
  • Loading branch information
Siquan Lv (silv) committed Dec 14, 2020
1 parent 3507652 commit 59ba21e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/main/java/net/lvsq/jgossip/net/udp/UDPMsgService.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ public class UDPMsgService implements MsgService {

@Override
public void listen(String ipAddress, int port) {
socket = Vertx.vertx().createDatagramSocket(new DatagramSocketOptions());
DatagramSocketOptions options = new DatagramSocketOptions();
options.setReceiveBufferSize(65535);
socket = Vertx.vertx().createDatagramSocket(options);
socket.listen(port, ipAddress, asyncResult -> {
if (asyncResult.succeeded()) {
socket.handler(packet -> handleMsg(packet.data()));
Expand Down

0 comments on commit 59ba21e

Please sign in to comment.