mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-10-25 13:31:55 +00:00
Supply the max packet size to EnetConnection.readPacket()
This commit is contained in:
1 parent
5fd105c9a9
commit
b3042312f6
2 files changed
+3
-3
No files matched your search
@@ -200,7 +200,7 @@ public class ControlStream implements ConnectionStatusListener, InputPacketSende
|
|||||||
synchronized (this) {
|
synchronized (this) {
|
||||||
sendPacket(packet);
|
sendPacket(packet);
|
||||||
if (context.serverGeneration >= ConnectionContext.SERVER_GENERATION_5) {
|
if (context.serverGeneration >= ConnectionContext.SERVER_GENERATION_5) {
|
||||||
enetConnection.readPacket(CONTROL_TIMEOUT);
|
enetConnection.readPacket(128, CONTROL_TIMEOUT);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
new NvCtlResponse(in);
|
new NvCtlResponse(in);
|
||||||
|
|||||||
@@ -37,8 +37,8 @@ public class EnetConnection implements Closeable {
|
|||||||
return conn;
|
return conn;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ByteBuffer readPacket(int timeout) throws IOException {
|
public ByteBuffer readPacket(int maxSize, int timeout) throws IOException {
|
||||||
ByteBuffer buffer = ByteBuffer.allocate(128);
|
ByteBuffer buffer = ByteBuffer.allocate(maxSize);
|
||||||
|
|
||||||
int readLength = readPacket(enetClient, buffer.array(), buffer.limit(), timeout);
|
int readLength = readPacket(enetClient, buffer.array(), buffer.limit(), timeout);
|
||||||
if (readLength <= 0) {
|
if (readLength <= 0) {
|
||||||
|
|||||||
Reference in new issue
Block a user