Author

Topic: [REVOKED] Networking problems on OSX. Libevent/Libev. (Read 1029 times)

legendary
Activity: 2198
Merit: 1989
฿uy ฿itcoin
Glad to hear you've found the problem Smiley
legendary
Activity: 1190
Merit: 1004
This offer is now revoked. I needed to call evthread_use_pthreads(); which I forgot to do.
legendary
Activity: 1190
Merit: 1004
Last chance: The stackoverflow bounty ends tomorrow. I've also raised the bitcoin bounty one last time to 0.3BTC. Not only that, but the price of bitcoin has risen quite substantially making this a much more attractive offer.
legendary
Activity: 1190
Merit: 1004
The stackoverflow bounty ends in two days, so make sure not to miss out! I have also raised the bitcoin bounty to 0.25BTC. Not only that, the price of bitcoin has been rising. I suspect this should be an easy problem to solve for anyone with experience of libevent or libel or perhaps socket programming on OSX.
legendary
Activity: 1190
Merit: 1004
Edit: This offer has been revoked as a solution has been found. evthread_use_pthreads(); was not called and it needed to be.

Hello!

I have a problem with the networking code in cbitcoin which only occurs with OSX. I've tried using the libevent and libev libraries and both of them seemingly give the same problem. I've got libevent and libev to work on Linux Mint. If you try running the tests for cbitcoin on OSX Mountain Lion, the testCBNodeFull should stall because the nodes do not receive events for the connection, nor does the connection timeout work. What I have done is try to create a minimised example of the problem which clearly shows that the connection events are not working. I looked at tcpdump, and it appears to me that the connection is established. For some reason testCBNetworkCommunicator works when the code is almost identical. I should also mention that sometimes it has been working for me, and once the connection event was fired but not the accept event. Most of the time none of the events fire.

The code for the minimised example and more information is shown on this stack overflow question: http://stackoverflow.com/questions/19364342/libevent-code-not-connecting-or-timing-out-on-osx-mountain-lion

You can download and try cbitcoin using:

Code:
git clone https://github.com/MatthewLM/cbitcoin.git
cd cbitcoin
./configure
make test

The problematic code can be found on the accountingAndNodes branch.

Use "make debug-test" to build and test with debug symbols enabled. The libev counterpart to the default libevent code is currently found in /experimental. You will need to modify the makefile slightly to get that to work which is a simple affair.

Thanks,

Matthew Mitchell
Jump to: