summaryrefslogtreecommitdiff
path: root/example/single_thread.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'example/single_thread.cpp')
-rw-r--r--example/single_thread.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/example/single_thread.cpp b/example/single_thread.cpp
index 71ddc4d5..fe584e2f 100644
--- a/example/single_thread.cpp
+++ b/example/single_thread.cpp
@@ -4,21 +4,32 @@
> Created Time: Fri 11 Sep 2020 09:52:05 AM CST
************************************************************************/
#include<stdio.h>
+#include<unistd.h>
#include"../src/hos_client.h"
int main(int argc, char *argv[])
{
- hos_client_handle handle = hos_client_init("192.168.44.12:9098/hos", "default", "defalut");
+ char *bucket = argv[1];
+ printf("hos_client_init start ...\n");
+ hos_client_handle handle = hos_client_init("http://192.168.44.12:9098/hos", "default", "default");
if (handle == NULL)
{
printf("error:hos_client_handle\n");
return -1;
}
+ printf("hos_client_init success ...");
- hos_create_bucket(handle, "my-first-bucket");
+ printf("hos_create_bucket start ... \n");
+ if(!hos_create_bucket(handle, bucket))
+ {
+ printf("hos_create_bucket failed ... \n");
+ }
+ printf("hos_create_bucket success ... \n");
- hos_upload_async(handle, "my-first-bucket", "my-file.txt");
+ printf("hos_upload_async start ...\n");
+ hos_upload_async(handle, bucket, "my-file.txt");
+ //sleep(30);
hos_client_close(handle);
return 0;