Will assign the correct server to nc.current
()
| 1967 | |
| 1968 | // Will assign the correct server to nc.current |
| 1969 | func (nc *Conn) pickServer() error { |
| 1970 | nc.current = nil |
| 1971 | if len(nc.srvPool) <= 0 { |
| 1972 | return ErrNoServers |
| 1973 | } |
| 1974 | |
| 1975 | for _, s := range nc.srvPool { |
| 1976 | if s != nil { |
| 1977 | nc.current = s |
| 1978 | return nil |
| 1979 | } |
| 1980 | } |
| 1981 | return ErrNoServers |
| 1982 | } |
| 1983 | |
| 1984 | const tlsScheme = "tls" |
| 1985 |