Skip to content

Instantly share code, notes, and snippets.

@pingkunga
Last active August 22, 2023 05:26
Show Gist options
  • Save pingkunga/bdfb50c5eede67269fa258e1d65e2aa0 to your computer and use it in GitHub Desktop.
Save pingkunga/bdfb50c5eede67269fa258e1d65e2aa0 to your computer and use it in GitHub Desktop.
TCP_JSON#01
TcpClient clientSocket;
clientSocket = new TcpClient();
try
{
clientSocket.Connect(host, port);
}
catch (SocketException socketEx)
{
throw new DSException("Connect-001", "Socket Exception", EXCEPTION_LEVEL.System, socketEx);
}
catch (ObjectDisposedException disposedException)
{
throw new DSException("Connect-001", "Object Disposed Exception", EXCEPTION_LEVEL.System, disposedException);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment