Changeset 757 in code for trunk/conn.go
- Timestamp:
- Dec 8, 2021, 5:03:40 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/conn.go
r748 r757 218 218 // If the connection is closed before the message is sent, SendMessage silently 219 219 // drops the message. 220 func (c *conn) SendMessage( msg *irc.Message) {220 func (c *conn) SendMessage(ctx context.Context, msg *irc.Message) { 221 221 c.lock.Lock() 222 222 defer c.lock.Unlock() … … 225 225 return 226 226 } 227 c.outgoing <- msg 227 228 select { 229 case c.outgoing <- msg: 230 // Success 231 case <-ctx.Done(): 232 c.logger.Printf("failed to send message: %v", ctx.Err()) 233 } 228 234 } 229 235
Note:
See TracChangeset
for help on using the changeset viewer.