Wait 15 seconds before reconnecting if the connection closed before registration finished
This commit is contained in:
parent
9669092148
commit
fde6a9e630
2 changed files with 28 additions and 6 deletions
|
@ -26,12 +26,13 @@ type Client struct {
|
|||
channels []string
|
||||
Support *iSupport
|
||||
|
||||
conn net.Conn
|
||||
connected bool
|
||||
dialer *net.Dialer
|
||||
reader *bufio.Reader
|
||||
backoff *backoff.Backoff
|
||||
out chan string
|
||||
conn net.Conn
|
||||
connected bool
|
||||
registered bool
|
||||
dialer *net.Dialer
|
||||
reader *bufio.Reader
|
||||
backoff *backoff.Backoff
|
||||
out chan string
|
||||
|
||||
quit chan struct{}
|
||||
reconnect chan struct{}
|
||||
|
@ -76,6 +77,19 @@ func (c *Client) Connected() bool {
|
|||
return connected
|
||||
}
|
||||
|
||||
func (c *Client) Registered() bool {
|
||||
c.lock.Lock()
|
||||
reg := c.registered
|
||||
c.lock.Unlock()
|
||||
return reg
|
||||
}
|
||||
|
||||
func (c *Client) setRegistered(reg bool) {
|
||||
c.lock.Lock()
|
||||
c.registered = reg
|
||||
c.lock.Unlock()
|
||||
}
|
||||
|
||||
func (c *Client) Nick(nick string) {
|
||||
c.Write("NICK " + nick)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue