Lines Matching defs:buf
33 char buf[MAXLEN];
37 while (fgets(buf, MAXLEN, stdin) != NULL) {
38 len = strlen(buf);
42 status = sendto(sockFD, buf, len, 0,
49 status = recvfrom(sockFD, buf, MAXLEN-1, 0, NULL, NULL);
54 buf[status] = 0;
55 printf("-> %s\n", buf);
63 char buf[MAXLEN];
68 strcpy(buf, "broadcast");
69 len = strlen(buf);
73 status = sendto(sockFD, buf, len, 0,
80 status = recvfrom(sockFD, buf, MAXLEN-1, 0, NULL, NULL);
85 buf[status] = 0;
86 printf("-> %s\n", buf);
93 char buf[MAXLEN];
101 status = recvfrom(sockFD, buf, MAXLEN-1, 0, (struct sockaddr*)&clientAddr, &len);
106 buf[status] = 0;
107 printf("got <%s> from client(%08x:%u)\n", buf, clientAddr.sin_addr.s_addr, clientAddr.sin_port);
109 if (islower(buf[i]))
110 buf[i] = toupper(buf[i]);
111 else if (isupper(buf[i]))
112 buf[i] = tolower(buf[i]);
114 printf("sending <%s>\n", buf);
115 status = sendto(sockFD, buf, status, 0,