fixed example code for sending dynamic data via tcp