basic tcp implementation, to be compile