private static void Receive(object thread_param) { object[] param_arr = thread_param as object[]; var sock_cli_remote = param_arr[0] as TcpClient; var sock_cli = param_arr[1] as TcpClient; try { Transfer(sock_cli_remote, sock_cli, bytes => { stat_obj stat = _stat_info[(int)param_arr[2]]; stat.ReceiveBytes += bytes; }); } catch (Exception exp) { //_l4n.Info(exp.Message); try { sock_cli_remote.Dispose(); sock_cli.Dispose(); } catch (Exception) { } } }
private static void Send(object thread_param) { object[] param_arr = thread_param as object[]; var from_sock = param_arr[0] as TcpClient; var to_sock = param_arr[1] as TcpClient; try { Transfer(from_sock, to_sock, bytes => { stat_obj stat = _stat_info[(int)param_arr[2]]; stat.SendBytes += bytes; }); } catch (Exception exp) { //_l4n.Info(exp.Message); } finally { try { from_sock.Dispose(); to_sock.Dispose(); } catch (Exception) { } } }