summaryrefslogtreecommitdiffstats
path: root/app_example
diff options
context:
space:
mode:
authorzqysara <zhangqiyu1@huawei.com>2018-08-14 19:22:00 +0800
committerzqysara <zhangqiyu1@huawei.com>2018-08-14 19:22:00 +0800
commitb420b93671bbd769d3cdeb4c7a85e0dcf9debb2e (patch)
tree45eb067e4a9233ba649411dc806aece7fc355510 /app_example
parent494f8fd412aa5243fb8c4978ddaf29421562b5fd (diff)
Fix: print error
send/recv print error Change-Id: I0838806a902a84faef9a2226209afa5040789ea9 Signed-off-by: zqysara <zhangqiyu1@huawei.com>
Diffstat (limited to 'app_example')
-rw-r--r--app_example/perf-test/multi_tcp_common_Ser.c4
-rw-r--r--app_example/perf-test/multi_tcp_epoll_app_Ser.c4
-rw-r--r--app_example/perf-test/multi_tcp_select_app_Ser.c4
3 files changed, 8 insertions, 4 deletions
diff --git a/app_example/perf-test/multi_tcp_common_Ser.c b/app_example/perf-test/multi_tcp_common_Ser.c
index 155958c..984052b 100644
--- a/app_example/perf-test/multi_tcp_common_Ser.c
+++ b/app_example/perf-test/multi_tcp_common_Ser.c
@@ -444,10 +444,10 @@ process_server_accept_thread (void *pArgv)
bind (listenFd, (struct sockaddr *) &g_recv, sizeof (struct sockaddr)))
{
printf ("ERROR:bind failed. fd[%d] errno [%d]\n", listenFd, errno);
- printf ("Info Bind Success, port %d IP:%s\n", ntohs (g_recv.sin_port),
+ printf ("INFO:Bind Failed, port %d IP:%s\n", ntohs (g_recv.sin_port),
inet_ntoa (*((struct in_addr *) &(g_recv.sin_addr.s_addr))));
close (listenFd);
- return;
+ exit (-1);
}
else
{
diff --git a/app_example/perf-test/multi_tcp_epoll_app_Ser.c b/app_example/perf-test/multi_tcp_epoll_app_Ser.c
index b853d68..270fbde 100644
--- a/app_example/perf-test/multi_tcp_epoll_app_Ser.c
+++ b/app_example/perf-test/multi_tcp_epoll_app_Ser.c
@@ -493,13 +493,15 @@ process_server_accept_thread (void *pArgv)
bind (listenFd, (struct sockaddr *) &g_recv, sizeof (struct sockaddr)))
{
printf ("ERROR:bind failed. fd[%d] errno [%d]\n", listenFd, errno);
+ printf ("INFO:Bind Failed, port %d IP:%s\n", ntohs (g_recv.sin_port),
+ inet_ntoa (*((struct in_addr *) &(g_recv.sin_addr.s_addr))));
close (listenFd);
//return NULL;
exit (-1);
}
else
{
- printf ("Info Bind Success, port %d IP:%s\n", ntohs (g_recv.sin_port),
+ printf ("INFO:Bind Success, port %d IP:%s\n", ntohs (g_recv.sin_port),
inet_ntoa (*((struct in_addr *) &(g_recv.sin_addr.s_addr))));
}
diff --git a/app_example/perf-test/multi_tcp_select_app_Ser.c b/app_example/perf-test/multi_tcp_select_app_Ser.c
index fb20be9..c1afe62 100644
--- a/app_example/perf-test/multi_tcp_select_app_Ser.c
+++ b/app_example/perf-test/multi_tcp_select_app_Ser.c
@@ -319,13 +319,15 @@ process_server_accept_thread (void *pArgv)
bind (listenFd, (struct sockaddr *) &g_recv, sizeof (struct sockaddr)))
{
printf ("ERROR:bind failed. fd[%d] errno [%d]\n", listenFd, errno);
+ printf ("INFO:Bind Failed, port %d IP:%s\n", ntohs (g_recv.sin_port),
+ inet_ntoa (*((struct in_addr *) &(g_recv.sin_addr.s_addr))));
close (listenFd);
//return NULL;
exit (-1);
}
else
{
- printf ("Info Bind Success, port %d IP:%s\n", ntohs (g_recv.sin_port),
+ printf ("INFO:Bind Success, port %d IP:%s\n", ntohs (g_recv.sin_port),
inet_ntoa (*((struct in_addr *) &(g_recv.sin_addr.s_addr))));
}