changed example to just close tcp socket