diff options
-rw-r--r-- | conn.go | 17 |
1 files changed, 5 insertions, 12 deletions
@@ -226,18 +226,11 @@ func (l *Conn) processMessages() { l.chanResults[messagePacket.MessageID] = messagePacket.Channel // go routine buf := messagePacket.Packet.Bytes() - for len(buf) > 0 { - n, err := l.conn.Write(buf) - if err != nil { - l.Debug.Printf("Error Sending Message: %s", err.Error()) - break - } - // nothing else to send - if n == len(buf) { - break - } - // the remaining buf content - buf = buf[n:] + + _, err := l.conn.Write(buf) + if err != nil { + l.Debug.Printf("Error Sending Message: %s", err.Error()) + break } case MessageResponse: l.Debug.Printf("Receiving message %d", messagePacket.MessageID) |