File tree Expand file tree Collapse file tree 1 file changed +17
-11
lines changed
Expand file tree Collapse file tree 1 file changed +17
-11
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,14 @@ public class TCPClient
3737 private StreamReader sr ;
3838 private NetworkStream ns ;
3939
40+ public int ReadTimeout
41+ {
42+ set
43+ {
44+ ns . ReadTimeout = value ;
45+ }
46+ }
47+
4048 public TCPClient ( string ip , int port )
4149 {
4250 client = new TcpClient ( ip , port ) ;
@@ -75,11 +83,6 @@ public void Flush()
7583 {
7684 sw . Flush ( ) ;
7785 }
78-
79- public void setReadTimeout ( int timeout )
80- {
81- ns . ReadTimeout = timeout ;
82- }
8386 }
8487
8588 public class TCPListener
@@ -105,6 +108,14 @@ public class TCPSocket
105108 private StreamReader sr ;
106109 private NetworkStream ns ;
107110
111+ public int ReadTimeout
112+ {
113+ set
114+ {
115+ ns . ReadTimeout = value ;
116+ }
117+ }
118+
108119 public TCPSocket ( object internalTCPData )
109120 {
110121 socket = ( Socket ) internalTCPData ;
@@ -143,11 +154,6 @@ public void Flush()
143154 {
144155 sw . Flush ( ) ;
145156 }
146-
147- public void setReadTimeout ( int timeout )
148- {
149- ns . ReadTimeout = timeout ;
150- }
151157 }
152158 }
153- }
159+ }
You can’t perform that action at this time.
0 commit comments