Finish tcp server/client