这是我第一次使用Reactor-netty。我一直在尝试建立一个Reactor Netty客户端并使用客户端连接来发送数据。
下面是我一直在尝试的
Set rng = ThisWorkbook.ActiveSheet.Range("b3,f3,l3,n3,p3,q3").EntireColumn
,但直到我处理为止,没有数据传输。仅当我呼叫
时才传输数据 'Copy Range from Excel
Dim lastRow As Long
With ThisWorkbook.ActiveSheet
lastRow = .Cells(Rows.Count, 2).End(xlUp).Row
' I assume your headers actually are in row 3, and the data is in row 4 on ward:
Set rng = ThisWorkbook.ActiveSheet.Range("b3:B" & lastRow & ",f3:F" & lastRow & ",l3:l" & lastRow & ",n3:N" & lastRow & ",p3:P" & lastRow & ",q3:Q" & lastRow)
Set rng1 = ThisWorkbook.ActiveSheet.Range("G4:I4")
End With
'Create an Instance of PowerPoint
On Error Resume Next
' Etc. etc.
我不想这样做,因为我想保持连接活跃并使用它发送其他数据
更新
错误实际上是private Connection connection;
Connection connectToTcp(String host, int port){
return TcpClient.create()
.host(host)
.port(port)
.option(ChannelOption.CONNECT_TIMEOUT_MILLIS, 10000)
.connectNow();
}
public void sendData(ByteBuffer buffer){
connection.outbound()
.sendObject(Flux.just(Unpooled.copiedBuffer(buffer.array())))
.then()
.subscribe();
}
,这实际上可以工作。创建的ByteBuff很大,导致服务器关闭了连接。通过将其替换为connection.onDispose().block();