10
10
using com . tvd12 . ezyfoxserver . client . socket ;
11
11
using static com . tvd12 . ezyfoxserver . client . constant . EzyConnectionStatuses ;
12
12
using com . tvd12 . ezyfoxserver . client . statistics ;
13
+ using com . tvd12 . ezyfoxserver . client . concurrent ;
13
14
14
15
namespace com . tvd12 . ezyfoxserver . client
15
16
{
@@ -40,15 +41,24 @@ public class EzyTcpClient :
40
41
protected readonly EzySocketClient socketClient ;
41
42
protected readonly EzyPingSchedule pingSchedule ;
42
43
protected readonly EzyLogger logger ;
44
+ protected readonly EzyEventLoopGroup eventLoopGroup ;
43
45
44
- public EzyTcpClient ( EzyClientConfig config )
46
+ public EzyTcpClient ( EzyClientConfig config ) : this ( config , null )
47
+ {
48
+ }
49
+
50
+ public EzyTcpClient (
51
+ EzyClientConfig config ,
52
+ EzyEventLoopGroup eventLoopGroup
53
+ )
45
54
{
46
55
this . config = config ;
47
56
this . name = config . getClientName ( ) ;
48
57
this . status = EzyConnectionStatus . NULL ;
49
58
this . status = EzyConnectionStatus . NULL ;
59
+ this . eventLoopGroup = eventLoopGroup ;
50
60
this . pingManager = new EzySimplePingManager ( config . getPing ( ) ) ;
51
- this . pingSchedule = new EzyPingSchedule ( this ) ;
61
+ this . pingSchedule = new EzyPingSchedule ( this , eventLoopGroup ) ;
52
62
this . handlerManager = new EzySimpleHandlerManager ( this ) ;
53
63
this . networkStatistics = new EzySimpleStatistics ( ) ;
54
64
this . requestSerializer = new EzySimpleRequestSerializer ( ) ;
@@ -73,6 +83,7 @@ protected EzySocketClient newSocketClient()
73
83
client . setPingManager ( pingManager ) ;
74
84
client . setNetworkStatistics ( networkStatistics ) ;
75
85
client . setHandlerManager ( handlerManager ) ;
86
+ client . setEventLoopGroup ( eventLoopGroup ) ;
76
87
client . setReconnectConfig ( config . getReconnect ( ) ) ;
77
88
client . setUnloggableCommands ( unloggableCommands ) ;
78
89
return client ;
0 commit comments