Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix msg-bittorrent's problem of incompletion
authorNicolas Bonichon <bonichon@labri.fr>
Mon, 18 Mar 2013 14:53:43 +0000 (15:53 +0100)
committerNicolas Bonichon <bonichon@labri.fr>
Mon, 18 Mar 2013 15:16:26 +0000 (16:16 +0100)
commitd36f84b566b47c107a58ac26c5f3886feb1db61c
treefeffb3b9158943a3eefda1caa059fa064fe4a1d1
parent2398ef453746c412c3b3be6523e7a2ac139e97bc
Fix msg-bittorrent's problem of incompletion

In the previous version, a peer wasn't able to handle more than
more message per second but could receive much more. As a consequence,
the application gets stuck because of queuing issue.

The problem comes from teh main loops (leech_loop() and seed_loop()))
each call of MSG_task_irecv() was followed by a call of
MSG_process_sleep(1) because the MSG_comm_test() always fails the
first time.

A call of MSG_mailbox_set_async() at the begining fixes this problem.

: in the main loops (leech_loop)
examples/msg/bittorrent/bittorrent.tesh [changed mode: 0644->0755]
examples/msg/bittorrent/peer.c