87 type client struct {
...
111 parseState
...
118 }
17 type parseState struct {
18 state int
19 as int
20 drop int
21 pa pubArg
22 argBuf []byte
23 msgBuf []byte
24 scratch [MAX_CONTROL_LINE_SIZE]byte
25 }
307 for cp := range c.pcd {
308 // Flush those in the set
310 if cp.nc != nil {
...
316 cp.nc.SetWriteDeadline(time.Now().Add(opts.WriteDeadline))
317 err := cp.bw.Flush()
318 cp.nc.SetWriteDeadline(time.Time{})
319 if err != nil {
...
324 } else {
325 // Update outbound last activity.
326 cp.last = last
327 // Check if we should tune the buffer.
328 sz := cp.bw.Available()
329 // Check for expansion opportunity.
330 if wfc > 2 && sz <= maxBufSize/2 {
331 cp.bw = bufio.NewWriterSize(cp.nc, sz*2)
332 }
333 // Check for shrinking opportunity.
334 if wfc == 0 && sz >= minBufSize*2 {
335 cp.bw = bufio.NewWriterSize(cp.nc, sz/2)
336 }
337 }
338 }
339 cp.mu.Unlock()
340 delete(c.pcd, cp)
341 }