alibaba / xquic

XQUIC Library released by Alibaba is a cross-platform implementation of QUIC and HTTP/3 protocol.
Apache License 2.0
1.7k stars 327 forks source link

[+] Add demo: simple io client/server #143

Closed Saigut closed 1 year ago

Saigut commented 2 years ago

Add a simple io demo, which do simple read/write on stream, and will display transmit speed.

CLAassistant commented 2 years ago

CLA assistant check
All committers have signed the CLA.

ruiqizhou commented 2 years ago

The original "demo" directory is actually used for interoperability testing, not demos. We are renaming it to "interop", see PR #112 for details.

The PR for Issue #148 will be submitted shortly.

So, my suggestion is not to put your simple_demo in the "demo" directory, but to create a new directory to avoid ambiguities and conflicts.

Saigut commented 2 years ago

How about this file structure?

xquic/
|- interop/
|- demo/
    |- demo_simple_io_common.h
    |- demo_simple_io_common.c
    |- demo_simple_io_server.c
    |- demo_simple_io_client.c
...

Or this:

xquic/
|- interop/
|- demo-simple/
    |- demo_simple_io_*
...

I think the first file structure would be more reasonable. What I would do is to add 4 new files into demo/ directory, and PR #112 can create interop/ and then move origin demo files to interop/.

ruiqizhou commented 2 years ago

How about this file structure?

xquic/
|- interop/
|- demo/
    |- demo_simple_io_common.h
    |- demo_simple_io_common.c
    |- demo_simple_io_server.c
    |- demo_simple_io_client.c
...

Or this:

xquic/
|- interop/
|- demo-simple/
    |- demo_simple_io_*
...

I think the first file structure would be more reasonable. What I would do is to add 4 new files into demo/ directory, and PR #112 can create interop/ and then move origin demo files to interop/.

I think it's reasonable.

@Kulsk But does this affect your current development work? I think you should review this PR and evaluate the impact.

Y7n05h commented 2 years ago

Thank you very much. The demo you added helped me a lot to understand the usage of xquic. But is this a bug? My understanding is that continue should be executed here instead of break.

https://github.com/alibaba/xquic/blob/a5550ea6dd8091fa9f6a9129f2c8b1b2be83d6e6/demo/demo_simple_io_server.c#L465-L467

Saigut commented 2 years ago

Thank you very much. The demo you added helped me a lot to understand the usage of xquic. But is this a bug? My understanding is that continue should be executed here instead of break.

https://github.com/alibaba/xquic/blob/a5550ea6dd8091fa9f6a9129f2c8b1b2be83d6e6/demo/demo_simple_io_server.c#L465-L467

Hi, here should be break. Because here should not wait for data in callback.

Y7n05h commented 2 years ago

Hi, here should be break. Because here should not wait for data in callback.

Oh, yes, you are right.

Saigut commented 1 year ago

Hello, since interop has been added, I think we can continue to consider merging this pr.

Kulsk commented 1 year ago

Hello, since interop has been added, I think we can continue to consider merging this pr.

What is this demo supposed to do? As there are already samples for stream read/write cases, it is not suggested to add another similar demo. I'm wondering if this io demo can be remade as a speed tester or some other tools else, to make it more different.