Next: , Previous: , Up: Interacting directly with other Peers using the CORE Service   [Contents]

4.5.3 Sending P2P Messages

You can transmit messages to other peers using the mq you were given during the connect callback. Note that the mq automatically is released upon disconnect and that you must not use it afterwards.

It is your responsibility to not over-fill the message queue, GNUnet will send the messages roughly in the order given as soon as possible.

Exercise: Write a service that upon connect sends messages as fast as possible to the other peer (the other peer should run a service that “processes” those messages). How fast is the transmission? Count using the STATISTICS service on both ends. Are messages lost? How can you transmit messages faster? What happens if you stop the peer that is receiving your messages?