I wake a morning and water to try to play a bit with bluetooth. So first i decide to see how to make communicate two raspberry PI using RFCOMM socket.

Then i find a really good book that describe how to start with bluez the linux API for bluetooth : An Introduction to Bluetooth Programming

The book contains great sample code to start my tests ... but it was not so easy to make them work.

I give here the main solution I have found to make the RFCOMM sample works.