9
9
using com . tvd12 . ezyfoxserver . client . request ;
10
10
using com . tvd12 . ezyfoxserver . client . socket ;
11
11
using static com . tvd12 . ezyfoxserver . client . constant . EzyConnectionStatuses ;
12
+ using com . tvd12 . ezyfoxserver . client . statistics ;
12
13
13
14
namespace com . tvd12 . ezyfoxserver . client
14
15
{
@@ -26,6 +27,7 @@ public class EzyTcpClient :
26
27
protected readonly EzyClientConfig config ;
27
28
protected readonly EzyPingManager pingManager ;
28
29
protected readonly EzyHandlerManager handlerManager ;
30
+ protected readonly EzyStatistics networkStatistics ;
29
31
protected readonly EzyRequestSerializer requestSerializer ;
30
32
31
33
protected EzyConnectionStatus status ;
@@ -45,6 +47,7 @@ public EzyTcpClient(EzyClientConfig config)
45
47
this . pingManager = new EzySimplePingManager ( config . getPing ( ) ) ;
46
48
this . pingSchedule = new EzyPingSchedule ( this ) ;
47
49
this . handlerManager = new EzySimpleHandlerManager ( this ) ;
50
+ this . networkStatistics = new EzySimpleStatistics ( ) ;
48
51
this . requestSerializer = new EzySimpleRequestSerializer ( ) ;
49
52
this . settingUp = new EzySimpleSetup ( handlerManager ) ;
50
53
this . unloggableCommands = newUnloggableCommands ( ) ;
@@ -65,6 +68,7 @@ protected EzySocketClient newSocketClient()
65
68
EzyTcpSocketClient client = newTcpSocketClient ( ) ;
66
69
client . setPingSchedule ( pingSchedule ) ;
67
70
client . setPingManager ( pingManager ) ;
71
+ client . setNetworkStatistics ( networkStatistics ) ;
68
72
client . setHandlerManager ( handlerManager ) ;
69
73
client . setReconnectConfig ( config . getReconnect ( ) ) ;
70
74
client . setUnloggableCommands ( unloggableCommands ) ;
@@ -308,6 +312,11 @@ public virtual void udpSend(EzyCommand cmd, EzyArray data)
308
312
{
309
313
throw new InvalidOperationException ( "only support TCP, use EzyUTClient instead" ) ;
310
314
}
311
- }
315
+
316
+ public EzyStatistics getNetworkStatistics ( )
317
+ {
318
+ return networkStatistics ;
319
+ }
320
+ }
312
321
313
322
}
0 commit comments