/// <summary> /// TCP调用 /// </summary> /// <param name="command">TCP调用命令</param> /// <returns>TCP调用是否成功</returns> public bool Call(byte[] command) { fastCSharp.net.tcpClient client = getClient(); try { return(client.Call(command)); } finally { saveClient(client); } }
/// <summary> /// TCP调用 /// </summary> /// <typeparam name="inputParameterType">输入参数类型</typeparam> /// <param name="command">TCP调用命令</param> /// <param name="inputParameter">输入参数</param> /// <returns>TCP调用是否成功</returns> public bool Call <inputParameterType>(byte[] command, inputParameterType inputParameter) where inputParameterType : fastCSharp.setup.cSharp.serialize.ISerialize { fastCSharp.net.tcpClient client = getClient(); try { return(client.Call(command, inputParameter)); } finally { saveClient(client); } }
/// <summary> /// TCP调用 /// </summary> /// <param name="command">TCP调用命令</param> /// <param name="onCall">回调委托,返回false表示失败</param> /// <returns>TCP调用客户端</returns> public fastCSharp.net.tcpClient Call(action <bool> onCall, byte[] command) { fastCSharp.net.tcpClient client = null; try { client = getClient(); } finally { if (client != null) { client.Call(new async <bool> { ClientPool = this, Client = client, OnReturn = onCall }.CallOnReturn, command); } else { onCall(false); } } return(client); }
/// <summary> /// TCP调用 /// </summary> /// <typeparam name="inputParameterType">输入参数类型</typeparam> /// <param name="onCall">回调委托,返回false表示失败</param> /// <param name="command">TCP调用命令</param> /// <param name="inputParameter">输入参数</param> /// <returns>TCP调用客户端</returns> public fastCSharp.net.tcpClient Call <inputParameterType>(action <bool> onCall, byte[] command, inputParameterType inputParameter) where inputParameterType : fastCSharp.setup.cSharp.serialize.ISerialize { fastCSharp.net.tcpClient client = null; try { client = getClient(); } finally { if (client != null) { client.Call(new async <bool> { ClientPool = this, Client = client, OnReturn = onCall }.CallOnReturn, command, inputParameter); } else { onCall(false); } } return(client); }