Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

做一个简单的上传和下载文件的测试用例,简单明了 #39

Closed
wwwllg opened this issue Nov 18, 2023 · 1 comment
Closed
Assignees

Comments

@wwwllg
Copy link

wwwllg commented Nov 18, 2023

折腾了一天,简单的例子都跑不起来。程序是编译成功了,对跨语言开发者其实是非常不友好的。但是需求大家是很清楚的。应该有一个简单的上传与下载文件的DEMO,就比较方便了。能得到第一时间上的直观反应。

@iyangsj
Copy link
Collaborator

iyangsj commented Nov 19, 2023

@wwwllg 感谢你的关注和建议!

你可以参考 https://tquic.net/zh/docs/getting_started/demo 文档说明,运行提供的示例程序。不过目前示例程序tquic_client只支持下载及保存文件。使用简述如下:

  • 执行如下命令启动tquic_server
./tquic_server -c cert.crt -k cert.key -l 127.0.0.1:8443

注意, tquic_server位于编译输出目录./target/release/, 使用到的 cert.crt/cert.key文件可从目录./src/tls/testdata/中拷贝

  • 执行如下命令使用tquic_client 下载文件
mkdir tmp
./tquic_client --connect-to 127.0.0.1:8443 https://example.org/libtquic.a --dump-path tmp/

这里tquic_client将获取并下载tquic_server基目录中libtquic.a文件,保存在tmp/ 目录中

如果想自行开发,可以进一步参考 https://tquic.net/zh/docs/tutorial/rust/ 使用流程。
源码中也提供了一个简单的C语言示例程序 https://github.com/Tencent/tquic/blob/develop/apps/src/bin/simple_server.c

如果你还是遇到问题,可以将具体的问题截图、诊断日志发出来。(运行tquic_client/tquic_server指定 --log-level trace 或 --log-level debug可以输出详细诊断日志)

@Tencent Tencent locked and limited conversation to collaborators Nov 19, 2023
@iyangsj iyangsj converted this issue into a discussion Nov 19, 2023
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants