private void closeTcp() { tcp.LingerState = new LingerOption(true, 5); tcp.Client.Shutdown(SocketShutdown.Both); tcp.Dispose(); tcp.Close(); tcp = null; }
public void Close() { if (tcp != null) { double begin = Logger.TimeVal(); closeTcp(); tcp = null; closeDuration = Logger.TimeVal() - begin; } }
public void Open() { double begin = Logger.TimeVal(); if (tcp != null) { tcp.Close(); } tcp = new RpcTcpClient(host, port); net = tcp.GetStream(); tcp.ReceiveTimeout = timeout; openDuration = Logger.TimeVal() - begin; }
public void Open() { double begin = Logger.TimeVal(); if (tcp != null) tcp.Close(); tcp = new RpcTcpClient(host, port); net = tcp.GetStream(); tcp.ReceiveTimeout = timeout; openDuration = Logger.TimeVal()-begin; }
public void Close() { if (tcp != null) { double begin = Logger.TimeVal(); closeTcp(); tcp = null; closeDuration = Logger.TimeVal()-begin; } }