Dissem / Jabit

Bitmessage Library for Java
Apache License 2.0
26 stars 10 forks source link

I have some questions about receiving messages #28

Open ShawnDeveloper opened 6 years ago

ShawnDeveloper commented 6 years ago

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 .

laubingam commented 6 years ago

@Dissem I alse hope your reply.

Dissem commented 5 years ago

I'm sorry for the late reply. I hope those answers will help:

  1. You will also need to call startup() on the context, so it starts connecting to the BM network
  2. 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.
  3. 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)
ShawnDeveloper commented 5 years ago

@Dissem By trying more times, messages can be sent and received. Thank you for your patient reply.