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-lionYou can download and try cbitcoin using:
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