Commit Graph

8 Commits

Author SHA1 Message Date
Jannis Mattheis ee723918f9 Add once test 2018-11-22 20:59:29 +01:00
Jannis Mattheis 79e1dc9c9a Prevent deadlock on stream.Close()
GR = goroutine
[GR#1] http server gets closed
[GR#2] client.NotifyClose() will be executed
[GR#2] client.once.Do will be executed (lock's client.once.m)
[GR#1] stream.Close will be executed (lock's stream.lock)
[GR#1] client.Close will be executed (waits for client.once.m)
[GR#2] stream.remove will be executed (waits for stream.lock)

GR#1 holds lock stream.lock and waits for client.once.m
GR#2 holds lock client.once.m and waits for stream.lock

We prevent the deadlock with releasing the client.once.m lock earlier.
2018-11-22 20:59:29 +01:00
Jannis Mattheis a992bc1506 Prevent possible race condition on SetPingHandler
conn.ReadMessage and conn.SetPingHandler are executed
in different goroutines.
2018-11-22 20:59:29 +01:00
Jannis Mattheis 80eec6ae3a Remove monkey dependency 2018-11-06 21:38:15 +01:00
Jannis Mattheis 1262f43846 Close web socket connection on delete user 2018-04-02 12:35:16 +02:00
Jannis Mattheis 6954fb5adf Close web socket connection on delete client 2018-04-02 12:35:16 +02:00
Jannis Mattheis 0f2e7cf5e2 Use gofmt -s 2018-03-25 19:33:29 +02:00
Jannis Mattheis 01c6800ae8 Move stream to api 2018-03-25 19:33:29 +02:00