Permalink
Browse files

Updating benchmark application with new protocol syntax and adding su…

…pport for the info command to the client application.
  • Loading branch information...
1 parent 34c6985 commit e63f3498213989bb96e6dee2b03adeb1dec68b54 @ngerakines committed Feb 25, 2010
Showing with 7 additions and 4 deletions.
  1. +1 −1 src/benchmark.c
  2. +6 −3 src/client.c
View
@@ -126,7 +126,7 @@ int main(int argc, char **argv) {
n = 0;
while (n < 1000) {
char msg[32];
- sprintf(msg, "update %d 1\r\n", list[n]);
+ sprintf(msg, "UPDATE %d 1\r\n", list[n]);
printf("Sending command 'update %d 1' ... ", list[n]);
send_command(sd, msg);
n++;
View
@@ -165,6 +165,8 @@ int main(int argc, char **argv) {
send_command(sd, "PEAK\r\n");
break;
case 4:
+ send_command(sd, "INFO\r\n");
+ break;
default:
break;
}
@@ -179,9 +181,9 @@ void send_command(int sd, char *command) {
perror("send");
exit(1);
}
- char buf[300];
+ char buf[1024];
int numbytes;
- if((numbytes = recv(sd, buf, 300-1, 0)) == -1) {
+ if((numbytes = recv(sd, buf, 1024-1, 0)) == -1) {
perror("recv()");
exit(1);
}
@@ -206,7 +208,8 @@ void send_command(int sd, char *command) {
}
break;
default:
- printf("protocol error, got '%c' as reply type byte\n", buf[0]);
+ printf("%s\n", buf);
+ // printf("protocol error, got '%c' as reply type byte\n", buf[0]);
break;
}
}

0 comments on commit e63f349

Please sign in to comment.