facebook / mvfst

An implementation of the QUIC transport protocol.
MIT License
1.5k stars 244 forks source link

Fail to write datagram #249

Closed dbaldassi closed 2 years ago

dbaldassi commented 2 years ago

Hi,

I'm trying to use the datagram extension. I have enable the datagram setting in the transport settings on both client and server like this :

quic::TransportSettings settings;
settings.datagramConfig.enabled      = true;
settings.datagramConfig.readBufSize  = 2048;
settings.datagramConfig.writeBufSize = 2048;

transport->setTransportSettings(settings);
transport->setDatagramCallback(_handler);

Then I try to send a message by calling the writeDatagram method but it is always failing. The issue seems to be because the maxWriteFrameSize is always 0.

auto state = transport->getState();
auto maxWriteFrameSize = state->datagramState.maxWriteFrameSize; // always == 0

Did I miss something in the configuration to write datagrams ?

kvtsoy commented 2 years ago

echo client/server in samples supports datagrams, maybe that code will help? echo --mode server --use_datagrams=true echo --mode client --use_datagrams=true