File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -94,6 +94,12 @@ type Client interface {
9494
9595// Client represents a MQTT client and implements the Client interface
9696type client struct {
97+ // These two int64s must be at the top to guarantee they are 64bit aligned
98+ // on 32bit architectures. If not then an attempt to store results in
99+ // segfault. See: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
100+ connectedAt int64
101+ disconnectedAt int64
102+
97103 server * server
98104 wg sync.WaitGroup
99105 rwc net.Conn //raw tcp connection
@@ -115,9 +121,6 @@ type client struct {
115121 keys map [string ]interface {}
116122 ready chan struct {} //close after session prepared
117123
118- connectedAt int64
119- disconnectedAt int64
120-
121124 statsManager SessionStatsManager
122125}
123126
You can’t perform that action at this time.
0 commit comments