// conn is the websocket connection that this writer is responsible for writing on.
conn*websocket.Conn
// channel is the channel used to receive server messages to be sent to the client.
// When it receives a SocketClosed, the process on the sending end promises not to send any further messages, as the writer will close it right after.
channelchanServerMessage
// readNotifications is the channel used to receive pings when the reader receives a message, so that a ping will be sent out before the reader is ready to time out.
// When it is closed, the reader has shut down.
readNotifications<-chantime.Duration
timer*time.Ticker
logger*zap.Logger
// timer is the timer used to send pings when the reader is close to timing out, to make sure the other end of the connection is still listening.
timer*time.Timer
// logger is the logger used to record the state of the writer, primarily in Debug level.
logger*zap.Logger
}
// act is the function responsible for actually doing the writing.