I know I've been bad in a few places, but this should use `atomic.CompareAndSwapInt32()`, ie:

```go
if !atomic.CompareAndSwapInt32(&this.state, StateConnected, StateDisconnected) {
    return
}
```