Skip to content

Commit

Permalink
Se resuelven algunos wanrings de compilacion
Browse files Browse the repository at this point in the history
  • Loading branch information
nforla committed Jul 17, 2019
1 parent 0755ea4 commit 39d01d0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cc = gcc
all: chatroom_server chatroom_client

chatroom_server: chatroom_server.c
cc chatroom_server.c -o chatroom_server -pthread -std=c99
cc chatroom_server.c -o chatroom_server -pthread -std=c99 -D_POSIX_C_SOURCE=200809L

chatroom_client: chatroom_client.c
cc -pthread chatroom_client.c -o chatroom_client -Wall `pkg-config --cflags --libs gtk+-3.0` -export-dynamic -g
Expand Down
Binary file removed chatroom_client
Binary file not shown.
Binary file removed chatroom_server
Binary file not shown.
8 changes: 5 additions & 3 deletions chatroom_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
#include <sys/socket.h>
#include <sys/types.h>
#include <netdb.h>
#include <strings.h>
#include <string.h>
#include <unistd.h>
#define HELLO_MSG "SERVER: Bienvenido al chatroom!"
#define CLI_DESC_MSG "%s se ha desconectado"
#define MAX_CLIENTS 10
Expand Down Expand Up @@ -61,13 +63,13 @@ int main(int argc, char const *argv[])
exit(0);
}

printf("Recieved client conn %d\n", connfd);
printf("> Recibida conexión de cliente. %d\n", connfd);

clients[server.active_connections].conn_id = server.active_connections;
clients[server.active_connections].server = &server;
clients[server.active_connections].client_addr = client_addr;
getnameinfo(&client_addr, sizeof client_addr, &clients[server.active_connections].host,
sizeof clients[server.active_connections].host, &clients[server.active_connections].service,
getnameinfo(&client_addr, sizeof client_addr, (char*)clients[server.active_connections].host,
sizeof clients[server.active_connections].host, (char*)clients[server.active_connections].service,
sizeof clients[server.active_connections].service, 0); // Gets hostname and service info

pthread_create(&client_threads[server.active_connections], NULL, client_thread, &clients[server.active_connections]);
Expand Down

0 comments on commit 39d01d0

Please sign in to comment.