clientWrite method
Future<int>
clientWrite(
- int clientPtr,
- ClientChannelType channelType,
- Uint8List buffer,
- int timeout,
发送buffer
@param clientPtr 客户端指针
@param channelType 要读取的通道ID @see ClientChannelType
@param buffer 发送buffer
@param timeout 超时时间 秒为单位
@return
0 发送成功,返回值为发送长度 -1 客户端未连接 -3 发送超时 -5 无效参数 -11 连接已失效 -12 远程关闭连接 -13 连接超时关闭 -15 远程接收buffer已满
Implementation
Future<int> clientWrite(int clientPtr, ClientChannelType channelType,
Uint8List buffer, int timeout) async {
if (_isNullOrZero(clientPtr) || channelType == null || buffer == null)
return -5;
var result = await _channel.invokeMethod(
"client_write", [clientPtr, channelType.index, buffer, timeout]);
return result;
}