forked from s444341/Projekt_SIK
Zaktualizuj 'server/server.c'
This commit is contained in:
parent
4c84927fd4
commit
2a468af441
@ -5,12 +5,14 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
struct client_socket
|
struct client_socket
|
||||||
{
|
{
|
||||||
int socket;
|
int socket;
|
||||||
struct sockaddr_in accept_adr;
|
struct sockaddr_in accept_adr;
|
||||||
|
char name[20] = "";
|
||||||
};
|
};
|
||||||
|
|
||||||
int main(void) {
|
int main(void) {
|
||||||
@ -19,7 +21,6 @@ int main(void) {
|
|||||||
char msg[1024];
|
char msg[1024];
|
||||||
client_socket client[7];
|
client_socket client[7];
|
||||||
fd_set Clients;
|
fd_set Clients;
|
||||||
struct sockaddr_in nadawca;
|
|
||||||
socklen_t dl = sizeof(struct sockaddr_in);
|
socklen_t dl = sizeof(struct sockaddr_in);
|
||||||
int i;
|
int i;
|
||||||
int j;
|
int j;
|
||||||
@ -63,6 +64,7 @@ int main(void) {
|
|||||||
if(ff == 'e') {
|
if(ff == 'e') {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
ff = 'a';
|
||||||
//Aktualizacja deskryptorów
|
//Aktualizacja deskryptorów
|
||||||
max_fd = 0;
|
max_fd = 0;
|
||||||
FD_ZERO(Clients);
|
FD_ZERO(Clients);
|
||||||
|
Loading…
Reference in New Issue
Block a user