completed a echo server between c client and scala server