Open
Description
Describe the bug
When i try to send message to NodeJS Socket.io Server, small message (< 32MB) is succeed but when payload more than 32MB => disconnect
event fired with reason transport close
. Sometime it send 1st big message succeed and another fail because timeout (client auto reconnect after disconnected)
Note: I also implemented ACK in both server and client
To Reproduce
Socket.IO server version: 4.5.2
with Express
Server
import { Server } from "socket.io";
const io = new Server(http, {
cors: {
origin: "*"
},
maxHttpBufferSize: 1e8,
pingTimeout: 60000,
pingInterval: 60000,
upgradeTimeout: 30000,
transport: ["websocket", "polling"]
})
Socket.IO java client version: 2.1.0
Client
public class MyApplication {
public static void main(String[] args) throws URISyntaxException {
IO.Options options = IO.Options.builder().build();
Socket socket = IO.socket("http://localhost:8081", options);
socket.connect();
socket.on(Socket.EVENT_DISCONNECT, msg -> log.info("Disconnected with socket server. Reason: {}", msg));
String msg = generateStringSize(1024 * 1024 * 32);
for(int i=0; i<10; i++) {
socket.emit("test", msg, new AckWithTimeout(20000) {
@Override
public void onSuccess(Object ...args) {
log.info("Send succeed");
}
@Override
public void onTimeout() {
log.info("Send failed");
}
});
}
socket.close();
}
private String generateStringSize(int bytes) {
StringBuilder builder = new StringBuiler;
for(int i=0; i<bytes/2; i++) {
builder.append("a");
}
return builder.toString();
}
}