File tree Expand file tree Collapse file tree 2 files changed +5
-0
lines changed
Expand file tree Collapse file tree 2 files changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -118,6 +118,8 @@ public static void ListenFromClientTCP() {
118118 while ( true ) {
119119 tcpToClient = tcpListener . AcceptTcpClient ( ) ;
120120 form . Log ( "client connected\n " , Color . Green ) ;
121+ tcpToClient . ReceiveTimeout = 100 ;
122+ tcpToClient . SendTimeout = 100 ;
121123
122124 tcpToClient . NoDelay = true ;
123125 Stream stream = tcpToClient . GetStream ( ) ;
@@ -137,6 +139,7 @@ public static void ListenFromClientTCP() {
137139 }
138140 catch ( ObjectDisposedException ) { }
139141 catch ( IOException ) { }
142+ tcpToClient . Close ( ) ;
140143 switch ( status ) {
141144 case BridgeStatus . Offline : //server crashed
142145 break ;
Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ public IPAddress IP {
2020 }
2121
2222 public Player ( TcpClient tcpClient ) {
23+ tcpClient . SendTimeout = 5000 ;
24+ //tcpClient.ReceiveTimeout = 60000;
2325 this . tcpClient = tcpClient ;
2426 var stream = tcpClient . GetStream ( ) ;
2527 reader = new BinaryReader ( stream ) ;
You can’t perform that action at this time.
0 commit comments