-
Notifications
You must be signed in to change notification settings - Fork 110
Expand file tree
/
Copy pathrun.sh
More file actions
executable file
·52 lines (42 loc) · 2.15 KB
/
Copy pathrun.sh
File metadata and controls
executable file
·52 lines (42 loc) · 2.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#
#
# Tencent is pleased to support the open source community by making tRPC available.
#
# Copyright (C) 2023 Tencent.
# All rights reserved.
#
# If you have downloaded a copy of the tRPC source code from Tencent,
# please note that tRPC source code is licensed under the Apache 2.0 License,
# A copy of the Apache 2.0 License is included in this file.
#
#
#! /bin/bash
# building.
bazel build //examples/features/http_async_upload_download/server:http_async_upload_download_server
bazel build //examples/features/http_upload_download/client:download_client
bazel build //examples/features/http_upload_download/client:upload_client
# run server.
echo "kill previous process: http_async_upload_download_server"
killall http_async_upload_download_server
sleep 1
# Prepares some files to store data.
dd if=/dev/urandom of=async_download_src.bin bs=1M count=10
dd if=/dev/urandom of=async_upload_dst.bin bs=1M count=0
echo "try to start..."
bazel-bin/examples/features/http_async_upload_download/server/http_async_upload_download_server --download_src_path="async_download_src.bin" --upload_dst_path="async_upload_dst.bin" --config=examples/features/http_async_upload_download/server/trpc_cpp_merge.yaml &
http_server_pid=$(ps -ef | grep 'bazel-bin/examples/features/http_async_upload_download/server/http_async_upload_download_server' | grep -v grep | awk '{print $2}')
if [ -n "http_server_pid" ]; then
echo "start successfully"
echo "http_async_upload_download_server is running, pid = $http_server_pid"
else
echo "start failed"
exit -1
fi
sleep 2
# Prepares some files to store data.
dd if=/dev/urandom of=download_dst.bin bs=1M count=0
dd if=/dev/urandom of=upload_src.bin bs=1M count=10
# run client.
bazel-bin/examples/features/http_upload_download/client/download_client --dst_path="download_dst.bin" --addr="127.0.0.1:24859" --client_config=examples/features/http_upload_download/client/trpc_cpp_fiber.yaml
bazel-bin/examples/features/http_upload_download/client/upload_client --src_path="upload_src.bin" --addr="127.0.0.1:24859" --use_chunked=true --client_config=examples/features/http_upload_download/client/trpc_cpp_fiber.yaml
killall http_async_upload_download_server