mirror of
https://github.com/moonlight-stream/moonlight-android.git
synced 2026-04-24 01:06:39 +00:00
Only use a socket timeout when handshaking on the control stream.
This commit is contained in:
@@ -64,7 +64,6 @@ public class ControlStream implements ConnectionStatusListener {
|
|||||||
public void initialize() throws IOException
|
public void initialize() throws IOException
|
||||||
{
|
{
|
||||||
s = new Socket();
|
s = new Socket();
|
||||||
s.setSoTimeout(CONTROL_TIMEOUT);
|
|
||||||
s.setTcpNoDelay(true);
|
s.setTcpNoDelay(true);
|
||||||
s.connect(new InetSocketAddress(host, PORT), CONTROL_TIMEOUT);
|
s.connect(new InetSocketAddress(host, PORT), CONTROL_TIMEOUT);
|
||||||
in = s.getInputStream();
|
in = s.getInputStream();
|
||||||
@@ -140,10 +139,16 @@ public class ControlStream implements ConnectionStatusListener {
|
|||||||
|
|
||||||
public void start() throws IOException
|
public void start() throws IOException
|
||||||
{
|
{
|
||||||
|
// Use a finite timeout during the handshake process
|
||||||
|
s.setSoTimeout(CONTROL_TIMEOUT);
|
||||||
|
|
||||||
sendConfig();
|
sendConfig();
|
||||||
pingPong();
|
pingPong();
|
||||||
send1405AndGetResponse();
|
send1405AndGetResponse();
|
||||||
|
|
||||||
|
// Return to an infinte read timeout after the initial control handshake
|
||||||
|
s.setSoTimeout(0);
|
||||||
|
|
||||||
heartbeatThread = new Thread() {
|
heartbeatThread = new Thread() {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
|
|||||||
Reference in New Issue
Block a user