send json through socket