recv and sending works with json protcol