replace InetSocketAddress decoding/encoding with side-stack argument passing

Signed-off-by: Ludovic Orban <lorban@bitronix.be>
This commit is contained in:
Ludovic Orban 2021-03-19 12:40:12 +01:00 committed by Simone Bordet
parent ee900b1a8d
commit 6267089b4f
2 changed files with 3 additions and 5 deletions

View File

@ -188,10 +188,9 @@ public class QuicConnection extends AbstractConnection
}
}
public void write(Callback callback, ByteBuffer... buffers)
public void write(Callback callback, InetSocketAddress remoteAddress, ByteBuffer... buffers)
{
InetSocketAddress address = ServerDatagramEndPoint.INET_ADDRESS_ARGUMENT.pop();
flusher.offer(callback, address, buffers);
flusher.offer(callback, remoteAddress, buffers);
flusher.iterate();
}

View File

@ -302,8 +302,7 @@ public class QuicSession
return Action.IDLE;
}
BufferUtil.flipToFlush(cipherBuffer, pos);
ServerDatagramEndPoint.INET_ADDRESS_ARGUMENT.push(remoteAddress);
connection.write(this, cipherBuffer);
connection.write(this, remoteAddress, cipherBuffer);
return Action.SCHEDULED;
}