Split main code into tcpserver.{h,cpp} and main