-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
you have to receive before you can send #16
Comments
I tried to verify this by first starting the receive-loop in background (see below) and after a delay sending messages. Next presumption would be, there are problems receiving messages in rapid succession. // handle incoming messages
c := make(chan error, 1)
go func() { // background rcv-loop
fmt.Println("handle incoming messages")
for receivedMessage := range receiveMsgChan {
...
}
c<-nil
}()
time.Sleep(2000 * time.Millisecond)
// send our initial message to our recipient
for i := 1; i <= 4; i++ {
txt := fmt.Sprintf("Initial message %d from o3demo1", i)
fmt.Printf("%s to [%s]\n", txt, rid)
err = ctx.SendTextMessage(rid, txt, sendMsgChan)
if err != nil {
log.Fatal(err)
}
}
<-c // Wait for receivedMessage-Loop to exit |
I think I need some help :) In But in the o3demo, where the same channel is polled via And now the receiving and sending is blocked. P.S: |
You were right with your assessment about buffered channels. We should (and wanted to, if I remember correctly) have done that from the beginning. I added buffered channels in 3d612b6. We'll have to find a more scalable solution in the long run but this should fix the error in question and will allow you to use the demo as is. |
…es that have a dynamic buffer size. This should be a better fix for #16 than implementing fixed-size buffers.
working on o3demo issue #7 I found a more basic error:
You have to receive (pending offline-messages) before you can send!
What I did:
Kind of "solve":
So I draw the conclusion, you have to receive all pending offline-messages before you can send your first message.
I did not try to find, whether this block comes from Threema servers or from the o3ma/o3-lib.
I'd expect the o3ma/o3-lib because Threema servers should not delete all pending offline-messages except the latest, only because I tried to send.
(Maybe this is dependent on some timing during startup of the demo. So maybe you can see it on one computer but not the other. I saw it on a Raspberry Pi 2 but not on my desktop.)
The text was updated successfully, but these errors were encountered: