fixed the code now?
This commit is contained in:
parent
02ecc16617
commit
04b2f1ebf7
3 changed files with 3 additions and 4 deletions
Binary file not shown.
|
|
@ -49,12 +49,11 @@ int main(int argc, char **argv)
|
||||||
if(strcmp(message, "time\n") == 0)
|
if(strcmp(message, "time\n") == 0)
|
||||||
{
|
{
|
||||||
//
|
//
|
||||||
printf("\nrecv\n");
|
char *reply;
|
||||||
|
sprintf(reply, "%d", time(NULL));
|
||||||
// char *reply = time(NULL);
|
// char *reply = time(NULL);
|
||||||
char *reply = "Replied";
|
// char *reply = "Replied";
|
||||||
printf("\nreply made\n");
|
|
||||||
sendto(socketTimeFD, (const char *)reply, strlen(reply), 0, (const struct sockaddr *) &clientAddr, clientAddrLen);
|
sendto(socketTimeFD, (const char *)reply, strlen(reply), 0, (const struct sockaddr *) &clientAddr, clientAddrLen);
|
||||||
printf("\nreply sent\n");
|
|
||||||
}
|
}
|
||||||
else if(strcmp(message, "close") == 0 || strcmp(message, "quit") == 0 || strcmp(message, "q") == 0)
|
else if(strcmp(message, "close") == 0 || strcmp(message, "quit") == 0 || strcmp(message, "q") == 0)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue