I am using this library
api('io.socket:socket.io-client:1.0.0') {
exclude group: 'org.json', module: 'json'
}
I am sending files using the code below. It works for small files up to about 6MB. But for larger files, like 30MB, it attempts to upload for about 5 seconds but then the socket automatically "reconnects" without uploading.
input = file.inputStream()
byteArray = input.readBytes()
val fileJson = JSONObject()
fileJson.put("file", byteArray)
socket.emit("media/upload", fileJson)
The server end seems fine, because it works from web to web.
Am I not doing it right?