()
| 2166 | } |
| 2167 | |
| 2168 | func (nc *Conn) newWriter() io.Writer { |
| 2169 | var w io.Writer = nc.conn |
| 2170 | if nc.Opts.FlusherTimeout > 0 { |
| 2171 | w = &timeoutWriter{conn: nc.conn, timeout: nc.Opts.FlusherTimeout} |
| 2172 | } |
| 2173 | return w |
| 2174 | } |
| 2175 | |
| 2176 | func (w *natsWriter) appendString(str string) error { |
| 2177 | return w.appendBufs([]byte(str)) |