adding safety measure in case Stop is called more than once
JP Robinson
7 years ago
185 | 185 | // get one last flush in |
186 | 186 | e.Flush() |
187 | 187 | // close the connection |
188 | return e.conn.Close() | |
188 | err := e.conn.Close() | |
189 | // nil the conn to avoid problems | |
190 | // if Stop() is called more than once. | |
191 | e.conn = nil | |
192 | return err | |
189 | 193 | } |
190 | 194 | |
191 | 195 | // Flush will attempt to create a connection with the given address |