-
I'm trying to write a simple client + server applications, in which QUIC would act as a transport for other protocol on top of it (not HTTP/3). I took a look at the examples (e.q. DOQ client + server) and I also read the documentation and I've identified a way to send data from QUIC server only as a reaction to some other QUIC event (with the use of Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 4 replies
-
hai @exe32 Could you please share your QUIC server and QUIC Client files where you are able to send data from QUIC Server to QUIC Client. Thank you. |
Beta Was this translation helpful? Give feedback.
-
Hello, I am currently dealing with a similar problem as @exe32 so I would really appreciate some help here with this question. |
Beta Was this translation helpful? Give feedback.
-
@Karthikdasari0423 full program is not yet in shareable form, I'm only doing some experiments which are very similar to what you can find in doq_server.py example. Basically QUIC Server sends data back as a reaction to QUIC event. Please find the cope snippet below:
I'm looking for an option here to send data from QUIC Server on demand at any point in time (once the connection is established of course). |
Beta Was this translation helpful? Give feedback.
-
@exe32 |
Beta Was this translation helpful? Give feedback.
-
I tried to implement my own QUIC server and client and I managed to figure it out, if you want to do it my way, you will need to use a little bit of threading. If you want to use this as a transport to another protocol like me, for example FTP or SSH server. Just initialize the QUIC connection as always, you can find it in the examples. On first quic_event_received function call, insert the identifier of event into some global Queue (identifier is in event.stream_id) variable and start a new thread (pass the receive QUIC data into the thread as argument). In the thread create a TCP socket for your TCP protocol, and send these data through TCP. After that, save the TCP socket connection to global variable, you will need that reference in the next quic_event_received. Finally make an infinite while loop in the thread, which will receive the data from socket with socket.recv() function. When the socket.recv() receive the TCP data back, check the Queue with stream ids. If the queue is not empty, then you know, that the QUIC client is waiting for some data. Therefore use the send_stream_data function with the identifier from queue, and received data from TCP to send data back to QUIC client through QUIC. In case, that the Queue is empty, you know, that client is not waiting for response, but your TCP protocol send you multiple responses to one request. In this case, call get_next_available_stream_id function, to generate the stream_id and send the data with new stream_id and received data back to client with send_stream_data function. As I mentioned, you will need the socket connection reference. Use that reference in next quic_event_received calls to send received QUIC data to the TCP protocol I assume that you are solving the similar problem as me. If you are not, this walkthrough is irrelevant and I am sorry. If you need some help you can contact me, and I can try to help you. |
Beta Was this translation helpful? Give feedback.
I tried to implement my own QUIC server and client and I managed to figure it out, if you want to do it my way, you will need to use a little bit of threading. If you want to use this as a transport to another protocol like me, for example FTP or SSH server. Just initialize the QUIC connection as always, you can find it in the examples. On first quic_event_received function call, insert the identifier of event into some global Queue (identifier is in event.stream_id) variable and start a new thread (pass the receive QUIC data into the thread as argument). In the thread create a TCP socket for your TCP protocol, and send these data through TCP. After that, save the TCP socket connection to…