File tree 2 files changed +4
-4
lines changed
2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ func newConnectMsgFromOptions(options *ClientOptions) *packets.ConnectPacket {
98
98
}
99
99
}
100
100
101
- m .KeepaliveTimer = uint16 (options .KeepAlive )
101
+ m .KeepaliveTimer = uint16 (options .KeepAlive . Seconds () )
102
102
103
103
return m
104
104
}
Original file line number Diff line number Diff line change @@ -47,7 +47,7 @@ func Test_NewClientOptions_mix(t *testing.T) {
47
47
o .SetClientID ("myclientid" )
48
48
o .SetUsername ("myuser" )
49
49
o .SetPassword ("mypassword" )
50
- o .SetKeepAlive (88 )
50
+ o .SetKeepAlive (88 * time . Second )
51
51
52
52
if o .Servers [0 ].Scheme != "tcp" {
53
53
t .Fatalf ("bad scheme" )
@@ -69,8 +69,8 @@ func Test_NewClientOptions_mix(t *testing.T) {
69
69
t .Fatalf ("bad set password" )
70
70
}
71
71
72
- if o .KeepAlive != 88 {
73
- t .Fatalf ("bad set timeout" )
72
+ if o .KeepAlive != 88000000000 {
73
+ t .Fatalf ("bad set timeout: %d" , o . KeepAlive )
74
74
}
75
75
}
76
76
You can’t perform that action at this time.
0 commit comments