Your program tries to connect to a TCP socket on localhost using port 13. Does anything actually run to accept connections on port 13?

If you are trying to make 2 of your programs talk together...