Changed the way Quit/Disconnect works to avoid possible DATA races.

Rewrote tests to be less spammy. Created REconnection test.
This commit is contained in:
Thomas Jager
2016-07-27 22:55:55 +02:00
parent a6b1561a01
commit 582bf80992
4 changed files with 84 additions and 53 deletions

View File

@@ -13,6 +13,7 @@ import (
)
type Connection struct {
sync.Mutex
sync.WaitGroup
Debug bool
Error chan error
@@ -46,7 +47,7 @@ type Connection struct {
Log *log.Logger
stopped bool
quit bool
quit bool //User called Quit, do not reconnect.
}
// A struct to represent an event.