summaryrefslogtreecommitdiffstats
path: root/conn.go
diff options
context:
space:
mode:
Diffstat (limited to 'conn.go')
-rw-r--r--conn.go17
1 files changed, 5 insertions, 12 deletions
diff --git a/conn.go b/conn.go
index 85f993d..02fbbdc 100644
--- a/conn.go
+++ b/conn.go
@@ -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)