TODO(gene): unify simpleByteSender and QueueOut QueueOut attempts to send a SCM to a session; if the send buffer is full, time out is 1 second
(msg *ServerComMessage)
| 138 | |
| 139 | // QueueOut attempts to send a SCM to a session; if the send buffer is full, time out is 1 second |
| 140 | func (s *Session) QueueOut(msg *ServerComMessage) { |
| 141 | data, _ := json.Marshal(msg) |
| 142 | select { |
| 143 | case s.send <- data: |
| 144 | case <-time.After(time.Second): |
| 145 | log.Println("session.queueOut: timeout") |
| 146 | } |
| 147 | } |
| 148 | |
| 149 | // Message received, dispatch |
| 150 | func (s *Session) dispatch(raw []byte) { |
no outgoing calls
no test coverage detected