pebbe / zmq4

A Go interface to ZeroMQ version 4

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subscriber Receiving packets very slowly

Pramod-Devireddy opened this issue · comments

Hi, the RecvBytes(0) function which I'm using inside goroutine is taking a lot of time to read messages. The publisher(c++) is sending messages continuously for every 10ms. The subscriber which is implemented in golang is taking sometimes more than 200ms to read. Due to which I'm experiencing packet losses.

start := time.Now()
contents, _ := Subscriber.RecvBytes(0)
elapsed := time.Since(start)
fmt.Printf("Execution Time: %s \n", elapsed)

Am I missing something?

This behaviour is due to a lot of subscription filters. If I subscribe with empty filter then all the messages are received immediately without any delay.