Jabit
Jabit copied to clipboard
I have some questions about receiving messages
Hi ,recently I am doing some work on your jabit SDK. But now I have some trouble with receiving messages. What should I do for receiving message ? 1,For receiving messages , the only thing I need to do is building the Context of BitmessageContext ? Is it right ? Is there anything else I have to do ? 2,Did the bmContext need the identity of address to receive messages ? Or the bmContext receives all the meesages , and get the specified message out of them by the identity of address ? 3,Based on the Question2 , Can I receive messages of three identities at the same time ?
Thank you for your reply .
@Dissem I alse hope your reply.
I'm sorry for the late reply. I hope those answers will help:
- You will also need to call startup() on the context, so it starts connecting to the BM network
- I'm not quite sure I understand the question. In order to receive messages sent to a specific address, the context must of course know the corresponding identity. Usually it's the other way: you create a new identity using the context, and start sending messages to its address. If you just want to start a relay that gets messages and distributes them, no identity is needed.
- Yes, you can have as many identities as you want. Please be aware that the more identities you have, the more CPU is used. I didn't make any tests, but 3 identities certainly are fine, with hundreds or thousands you might experience some issues. (In case you do any tests, I would be interested in the results)
@Dissem By trying more times, messages can be sent and received. Thank you for your patient reply.