Exemplo n.º 1
0
int main(int argc,char **argv)
{
    mutil_thread = 0;
    setup_signal_handler();
    init_clients();
    InitNetSystem();
    ENGINE engine = CreateEngine();
    int csize = atoi(argv[3]);
    int i = 0;
    for(; i < csize; ++i)
        EConnect(engine,argv[1],atoi(argv[2]),(void*)engine,on_connect,1000);
    uint32_t tick,now;
    tick = now = GetSystemMs();
    while(!stop) {
        EngineRun(engine,50);
        sendpacket();
        now = GetSystemMs();
        if(now - tick > 1000)
        {
            printf("ava_interval:%d\n",ava_interval);
            tick = now;
        }
    }
    CleanNetSystem();
    return 0;
}
Exemplo n.º 2
0
int main(int argc,char **argv)
{
	init_net_service();
	ip = argv[1];
	port = atoi(argv[2]);
	uint32_t thread_count = atoi(argv[3]);
	init_clients();	
	netservice_t n = create_net_service(thread_count);
	net_add_listener(n,ip,port);
	msg_loop_t m = create_msg_loop(server_process_packet,process_new_connection,process_connection_disconnect,process_send_block);
	uint32_t now;
	uint32_t tick = GetSystemMs();
	while(1)
	{
		msg_loop_once(m,n,100);	
		now = GetSystemMs();
		if(now - tick > 1000)
		{
			printf("total send:%u,total_recv:%u\n",isusecount,total_bytes_recv/1024/1024);
			//printf("w:%d,r:%d,b:%d\n",wpacket_count,rpacket_count,buf_count);
			tick = now;
			total_bytes_recv = 0;
			send_count = 0;
		}
	}

	return 0;
}
Exemplo n.º 3
0
int main(int argc, char *argv[]) {
    if (argc < 3) {
        printf("Not enough arguments");
        exit(1);
    }
    key_t habit = ftok(argv[1], atoi(argv[2]));
    if (habit < 0) {
        perror(NULL);
        exit(1);
    }
    zakonnica = msgget(habit, IPC_CREAT | S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH
                              | S_IWOTH);
    if (zakonnica == -1) {
        perror(NULL);
        exit(2);
    }

    signal(SIGINT, handler);
    srand(time(NULL));
    atexit(close);

    init_clients();

    while (1) {
        struct msg message;
        if (msgrcv(zakonnica, &message, sizeof(message), 0, IPC_NOWAIT) >= 0) {
            long type = message.mtype;
            switch (type) {
                case NEWCLNT: {
                    int new_id = get_id();
                    if (new_id !=-1) {
                        int cl = message.client_id;
                        clients[new_id] = message.client_id;
                        message.mtype = SERACCLIENT;
                        message.client_id = new_id;
                        if (msgsnd(cl, &message, sizeof(message), 0)) {
                            perror(NULL);
                            exit(2);
                        }
                    }
                    break;
                }
                case CLRESP: {
                    if (message.is_prime) {
                        printf("Liczba pierwsza: %d klient %d\n", message.number, message.client_id);
                    }
                    break;
                }
                case GETNEXT: {
                    message.number = rand() % 10000;
                    msgsnd(clients[message.client_id], &message, sizeof(message), 0);
                    break;
                }
                default:
                    break;
            }
        }
    }
}
Exemplo n.º 4
0
int main(int argc,char **argv)
{

	HANDLE engine;
	uint32_t n;
	
	ip = argv[1];
	port = atoi(argv[2]);
	signal(SIGPIPE,SIG_IGN);
	if(InitNetSystem() != 0)
	{
		printf("Init error\n");
		return 0;
	}
	wpacket_allocator = (allocator_t)create_block_obj_allocator(0,sizeof(struct wpacket));	

	uint32_t i = 0;
	//getchar();
	//init_wpacket_pool(100000);
	//init_rpacket_pool(50000);
	//buffer_init_maxbuffer_size(2000);
	//buffer_init_64(2000);
	init_clients();

	engine = CreateEngine();
	thread_run(_Listen,&engine);
	tick = GetSystemMs();
	while(1)
	{
		EngineRun(engine,15);
		now = GetSystemMs();
		if(now - tick > 1000)
		{
			printf("recv:%u,send:%u,s_req:%u\n",packet_recv,packet_send,send_request);
			tick = now;
			packet_recv = 0;
			packet_send = 0;
			send_request = 0;
			s_p = 0;
			iocp_count = 0;
			recv_count = 0;
		}
		/*if(now - last_send_tick > 50)
		{
			//心跳,每50ms集中发一次包
			last_send_tick = now;
			for(i=0; i < MAX_CLIENT; ++i)
			{
				if(clients[i])
				{
					//++send_request;
					connection_send(clients[i],0,0);
				}
			}
		}*/
		
	}
	return 0;
}
Exemplo n.º 5
0
int main(int argc,char **argv)
{

	HANDLE engine;
	uint32_t n;
	init_system_time(10);
	ip = argv[1];
	port = atoi(argv[2]);
	signal(SIGPIPE,SIG_IGN);
	if(InitNetSystem() != 0)
	{
		printf("Init error\n");
		return 0;
	}
	wpacket_allocator = (allocator_t)create_block_obj_allocator(SINGLE_THREAD,sizeof(struct wpacket));	

	uint32_t i = 0;
	init_clients();

	engine = CreateEngine();
	thread_run(_Listen,&engine);
	tick = GetSystemMs();
	while(1)
	{
		EngineRun(engine,100);
		now = GetSystemMs();
		if(now - tick > 1000)
		{
			printf("recv:%u,send:%u,s_req:%u,total_recv:%u\n",packet_recv,packet_send,send_request,total_bytes_recv/1024/1024);
			tick = now;
			packet_recv = 0;
			packet_send = 0;
			send_request = 0;
			iocp_count = 0;
			total_bytes_recv = 0;
			//printf("w:%d,r:%d,b:%d\n",wpacket_count,rpacket_count,buf_count);
		}
		/*
		if(now - last_send_tick > 10)
		{
			last_send_tick = now;
			for(i=0; i < MAX_CLIENT; ++i)
			{
				if(clients[i])
				{
					connection_send(clients[i],NULL,NULL);
				}
			}
		}*/
		
	}
	return 0;
}
Exemplo n.º 6
0
int32_t main()
{
	DWORD dwThread;
	HANDLE iocp;
	uint32_t n;

	uint32_t i = 0;
	//getchar();
	init_wpacket_pool(10000000);
	init_rpacket_pool(500000);
	buffer_init_maxbuffer_size(2000);
	buffer_init_64(2000);
	init_clients();
	InitNetSystem();
	iocp = CreateNetEngine(1);

	CreateThread(NULL,0,Listen,&iocp,0,&dwThread);
	tick = GetTickCount();
	while(1)
	{
		RunEngine(iocp,15);
		/*now = GetTickCount();
		if(now - tick > 1000)
		{
			printf("recv:%u,send:%u,s_req:%u,pool_size:%u,bf:%u,sp:%u,iocp:%u\n",packet_recv,packet_send,send_request,wpacket_pool_size(),bf_count,s_p,iocp_count);
			tick = now;
			packet_recv = 0;
			packet_send = 0;
			send_request = 0;
			s_p = 0;
			iocp_count = 0;
		}
		if(now - last_send_tick > 50)
		{
			//心跳,每50ms集中发一次包
			last_send_tick = now;
			for(i=0; i < MAX_CLIENT; ++i)
			{
				if(clients[i])
				{
					++send_request;
					connection_send(clients[i],0,0);
				}
			}
		}*/
	}
	return 0;
}
Exemplo n.º 7
0
int main(int argc,char **argv)
{
    mutil_thread = 0;
	setup_signal_handler();
	init_clients();
    InitNetSystem();
    struct netservice *tcpserver = new_service();
	tcpserver->listen(tcpserver,argv[1],atoi(argv[2]),(void*)tcpserver,accept_client);
	uint32_t tick,now;
    tick = now = GetSystemMs();
	while(!stop){
		tcpserver->loop(tcpserver,50);
        now = GetSystemMs();
		if(now - tick > 1000)
		{
			printf("client_count:%d,send_count:%d\n",client_count,(packet_send_count*1000)/(now-tick));
			tick = now;
			packet_send_count = 0;
		}
	}
	destroy_service(&tcpserver);
    CleanNetSystem();
    return 0;
}
Exemplo n.º 8
0
int main(int argc, char *argv[]){
	key_t key; 
	if( (key = ftok(CHAT_PATH,CHAT_KEY)) == -1)
		print_error(errno, "ftok error");	
	
	int registration_queue;
	if( (registration_queue = msgget(key, IPC_CREAT | 0600)) == -1)
	       print_error(errno, "msgget error");	

	struct message message;
	struct client *clients = malloc(sizeof(struct client) * MAX_CLIENTS_NUMBER);
	init_clients(clients);
	while(1){
		usleep(500000);
		if(msgrcv(registration_queue, &message, MAX_CLIENT_NAME_LENGTH, 0, IPC_NOWAIT) == -1){
			if(errno == E2BIG)
				print_error(errno, "client name too long");
			else if (errno != ENOMSG) // empty queue is ok
				print_error(errno, "msgrcv server_queue error");
		} else {
			int i;
			for(i = 0; i < MAX_CLIENTS_NUMBER; i++){
				if(clients[i].name[0] == '\0') break;
			}
			if(clients[i].name[0] != '\0')
				print_error(errno, "maximum number of clients already reached");
			else {
				key_t tmp_client_key;
				strcpy(clients[i].name, message.message);
				if( (tmp_client_key = ftok(CHAT_PATH, message.type)) == -1)
					print_error(errno, "ftok client error");
				if( (clients[i].queue = msgget(tmp_client_key, 0600)) == -1)
					print_error(errno, "msgget klient error");
				char *info1 = "------------  ";
				char *info2 =" has  joined the channel  ------------\n"; 
				char m[strlen(info1) + strlen(info2) + strlen(clients[i].name) + 1];
				strcpy(m, info1);
				strcat(m, clients[i].name);
				strcat(m, info2);
				send_message(m, i, clients);
			}
		}

		int i;
		for(i = 0; i < MAX_CLIENTS_NUMBER; i++){
			if(clients[i].name[0] != '\0'){
				if(msgrcv(clients[i].queue, &message, MAX_MESSAGE_SIZE, CLIENT_TO_SERVER, IPC_NOWAIT) == -1){
					
					int tmp_errno = errno;
					if(tmp_errno == EINVAL){
						char *info1 = "------------  ";
						char *info2 =" has  left the channel  ------------"; 
						char m[strlen(info1) + strlen(info2) + strlen(clients[i].name) + 1];
						strcpy(m, info1);
						strcat(m, clients[i].name);
						strcat(m, info2);
						clients[i].name[0] = '\0';
						send_message(m, i, clients);
					} else if (tmp_errno != ENOMSG)
						print_error(tmp_errno, "error in msgrcv in message reciver loop");
				} else if (strcmp(message.message, "exit\n") !=0){
					send_message(message.message, i, clients);
				}
			}

		}
	}
}
Exemplo n.º 9
0
int main(int argc, char *argv[]) {
    struct mq_attr attr;
    attr.mq_flags = 0;
    attr.mq_maxmsg = 10;
    attr.mq_msgsize = MAX_SIZE;
    attr.mq_curmsgs = 1;
    char message[MAX_SIZE + 1];
    zakonnica = mq_open("/server", O_CREAT | O_RDONLY, S_IRUSR | S_IWUSR, &attr);
    if (zakonnica == -1) {
        perror("open queue");
        exit(1);
    }

    signal(SIGINT, handler);
    srand(time(NULL));
    atexit(clean);
    init_clients();

    while (1) {
        if (mq_receive(zakonnica, message, MAX_SIZE, 0) >= 0) {
            long type = message[0];
            switch (type) {
                case NEWCLNT: {
                    int new_id = get_id();
                    int cl_q = -1;
                    if (new_id != -1) {
                        cl_q = mq_open(message + 1, O_WRONLY, 0, &attr);
                        clients[new_id] = cl_q;
                        if (cl_q == -1)
                            new_id = -1;
                    }
                    message[0] = SERACCLIENT;
                    sprintf(message + 1, "%d", new_id);
                    if (mq_send(cl_q, message, MAX_SIZE, 0)) {
                        perror("send");
                        exit(2);
                    }
                    break;
                }
                case CLRESP: {
                    int clientid;
                    int number;
                    int isprime;
                    sscanf(message + 1, "%d %d %d", &clientid, &number, &isprime);
                    if (isprime) {
                        printf("Liczba pierwsza: %d klient %d\n", number, clientid);
                    }
                    break;
                }
                case GETNEXT: {
                    int tmp = rand() % 100;
                    int cl_q;
                    sscanf(message + 1, "%d", &cl_q);
                    sprintf(message + 1, "%d", tmp);
                    if (mq_send(clients[cl_q], message, MAX_SIZE, 0) < 0) {
                        perror(NULL);
                    }
                    break;
                }
                case CLSCLNT: {
                    int client_id;
                    sscanf(message + 1, "%d", &client_id);
                    mq_close(clients[client_id]);
                    clients[client_id] = -1;
                    break;
                }
                default:
                    break;
            }
        }
    }
}
Exemplo n.º 10
0
int main(int argc, char **argv)
{
    int i, ret, become_daemon = 1;

    for(i=1; i<argc; i++) {
        if(argv[i][0] == '-' && argv[i][2] == 0) {
            switch(argv[i][1]) {
            case 'd':
                become_daemon = !become_daemon;
                break;

            case 'v':
                verbose = 1;
                break;

            case 'h':
                printf("usage: %s [options]\n", argv[0]);
                printf("options:\n");
                printf("  -d\tdo not daemonize\n");
                printf("  -v\tverbose output\n");
                printf("  -h\tprint this usage information\n");
                return 0;

            default:
                fprintf(stderr, "unrecognized argument: %s\n", argv[i]);
                return 1;
            }
        } else {
            fprintf(stderr, "unexpected argument: %s\n", argv[i]);
            return 1;
        }
    }

    if(become_daemon) {
        daemonize();
    }
    write_pid_file();

    puts("Spacenav daemon " VERSION);

    read_cfg("/etc/spnavrc", &cfg);

    if(init_clients() == -1) {
        return 1;
    }

    signal(SIGINT, sig_handler);
    signal(SIGTERM, sig_handler);
    signal(SIGSEGV, sig_handler);
    signal(SIGHUP, sig_handler);
    signal(SIGUSR1, sig_handler);
    signal(SIGUSR2, sig_handler);

    if(init_dev() == -1) {
        init_hotplug();
    }
    init_unix();
#ifdef USE_X11
    init_x11();
#endif

    atexit(cleanup);

    for(;;) {
        fd_set rset;
        int fd, max_fd = 0;
        struct client *c;

        FD_ZERO(&rset);

        /* set the device fd if it's open, otherwise set the hotplug fd */
        if((fd = get_dev_fd()) != -1 || (fd = get_hotplug_fd()) != -1) {
            FD_SET(fd, &rset);
            if(fd > max_fd) max_fd = fd;
        }

        /* the UNIX domain socket listening for connections */
        if((fd = get_unix_socket()) != -1) {
            FD_SET(fd, &rset);
            if(fd > max_fd) max_fd = fd;
        }

        /* all the UNIX socket clients */
        c = first_client();
        while(c) {
            if(get_client_type(c) == CLIENT_UNIX) {
                int s = get_client_socket(c);
                assert(s >= 0);

                FD_SET(s, &rset);
                if(s > max_fd) max_fd = s;
            }
            c = next_client();
        }

        /* and the X server socket */
#ifdef USE_X11
        if((fd = get_x11_socket()) != -1) {
            FD_SET(fd, &rset);
            if(fd > max_fd) max_fd = fd;
        }
#endif

        do {
            ret = select(max_fd + 1, &rset, 0, 0, 0);
        } while(ret == -1 && errno == EINTR);

        if(ret > 0) {
            handle_events(&rset);
        }
    }
    return 0;	/* unreachable */
}
Exemplo n.º 11
0
int main(int argc,char *argv[]) {

	int socktemp;
	char message[MAX_MESSAGES];
	int message_length;

    // Initialisation de la socket
    socketInit = socket (AF_INET,SOCK_STREAM ,IPPROTO_TCP );
    if(socketInit==-1)
	{
		printf("\n ERREUR lors de la création de la socket côté serveur");
		return -1;
	}
        
    struct	sockaddr_in  serveur,client;
    unsigned short port = atoi(argv[1]);
        
    //initialisation de la structure sockaddr_in
    serveur.sin_family = AF_INET;
    serveur.sin_port = port;
    serveur.sin_addr.s_addr = INADDR_ANY;
    
    // liaison de la socket avec l'adresse IP et port du serveur
	if (bind(socketInit, (struct sockaddr*) &serveur, sizeof(serveur)) == -1){
		printf("ERREUR lors du bind côté serveur\n");
		return -1;
	}

	// mise en ecoute du serveur
	if (listen(socketInit, MAX_CLIENTS) == -1){
		printf("ERREUR lors du listen côté serveur\n");
		return -1;
	}
    
    int lg_client;
    FD_ZERO(&set); // initialisation de la liste
    int maxsock = getdtablesize(); 
	FD_SET(socketInit,&set); // ajout du socket du serveur dans la liste
	
	init_clients();	
	printf("\nServeur prêt : attente de clients...\n");	
	
    while (1)
    {
		bcopy ( (char*) &set, (char*) &setbis, sizeof(set)) ; // On réinitialise set à chaque fois
		
		select(maxsock, &setbis, 0, 0, 0);
		//Socket du serveur pret a etre lu: connexion d'un nouveau client
		if (FD_ISSET(socketInit, &setbis))
		{
		    socktemp = accept(socketInit,(struct sockaddr *)&client, &lg_client); 
			if (socktemp == -1) 
			{
				printf("Erreur lors de la connexion d'un client\n");
				return -1;
			}
			else
			{
				ajouter_client(socktemp); // s'il n'y a pas d'erreur on ajoute le client
			}
		}
		for(int i=0;i<MAX_CLIENTS;i++)
		{
			//On vérifie si les clients ont une requête
			if(les_clients[i].socket!=-1 && FD_ISSET( les_clients[i].socket, &setbis))
			{
				message_length = read(les_clients[i].socket,message, MAX_MESSAGES);
				message[message_length]='\0';
				traiter_requete_client(i,message);
			}
		}
 
    }
}
Exemplo n.º 12
0
void WindowManager::init_internals(void)
{
	ELOG("Starting window manager");
	wm_conf = new WindowManagerConfig;

	app_starting = false;

	// defaults, in case world goes down
	wm_conf->title_active_color = fl_rgb(0,0,128);
	wm_conf->title_active_color_text = fl_rgb(255,255,255);
	wm_conf->title_normal_color = fl_rgb(192,192,192);
	wm_conf->title_normal_color_text = fl_rgb(0,0,128);
	wm_conf->title_label_align = FL_ALIGN_LEFT;
	wm_conf->title_height = 20;
	wm_conf->title_box_type = 0;
	wm_conf->frame_do_opaque = false;
	wm_conf->frame_animate = true;
	wm_conf->frame_animate_speed = 15;

	fl_open_display();
	XSetErrorHandler(xerror_handler);
	wm_area.set(0, 0, Fl::w(), Fl::h());

	read_configuration();
	read_xset_configuration();

	//register_protocols();
#ifdef _DEBUG
	InitAtoms(fl_display, atom_map);
	register_events();
#else
	InitAtoms(fl_display);
#endif

	//cur = XCreateFontCursor(fl_display, XC_left_ptr);
	//XDefineCursor(fl_display, RootWindow(fl_display, fl_screen), cur);
	// load cursor
	cur = new CursorHandler;
	cur->load(X_CURSORS);
	cur->set_root_cursor();

	sound_system = new SoundSystem();
	sound_system->init();

	sound_system->add(SOUND_MINIMIZE, "sounds/minimize.ogg");
	sound_system->add(SOUND_MAXIMIZE, "sounds/maximize.ogg");
	sound_system->add(SOUND_CLOSE,    "sounds/close.ogg");
	sound_system->add(SOUND_RESTORE,  "sounds/restore.ogg");
	sound_system->add(SOUND_SHADE,    "sounds/shade.ogg");

	// the world is starting here
	show();
	register_protocols();

	hint_stuff = new Hints;
	hint_stuff->icccm_set_iconsizes(this);

	init_clients();
	Fl::add_handler(wm_event_handler);
	XSync(fl_display, 0);

	is_running = true;
}
Exemplo n.º 13
0
DWORD APIENTRY WinSock ( LPVOID threadNum )
{
	// call Socket library (initialize)
	WSADATA sd;
	SYSTEMTIME nowtime;
	WORD ver=0x0101;
	SOCKET svrSck,sck;
	DWORD arg;
	SOCKADDR_IN addr;
	fd_set rfd,efd;
	SOCKADDR_IN ad;
	struct timeval timeout;
	int len;
	char szMessage[1000];
	client clt;
	HINSTANCE hInstance = *(HINSTANCE *) threadNum ;

	HANDLE hThread = NULL ;
	DWORD ThreadID = 0L ;
	

	init_clients(); // Initialize users' list
	if(WSAStartup(ver,&sd))
	{
		LoadString ( hInstance , IDS_INIT_FAILURE , szMessage , sizeof (szMessage ) ) ;
		MessageBox ( hCurDlg , szMessage , szCaption , MB_ICONERROR ) ;
		ExitProcess ( EXIT_FAILURE ) ;
	}
	// Create Socket
	svrSck=socket(AF_INET,SOCK_STREAM,0);
	if(svrSck==INVALID_SOCKET)
	{
		WSACleanup ( );
		LoadString ( hInstance , IDS_CREATION_FAILED , szMessage , sizeof ( szMessage ) ) ;
		MessageBox ( hCurDlg , szMessage , szCaption , MB_ICONERROR ) ;
		ExitProcess ( EXIT_FAILURE ) ;
	}
	// Set Socket running mode
	arg=1;
	ioctlsocket(svrSck,FIONBIO,&arg); // Set non-blocking mode
	// bind
	addr.sin_family=AF_INET;
	addr.sin_port=htons(2007);
	addr.sin_addr.s_addr = htonl(ADDR_ANY);
	if(bind(svrSck,(SOCKADDR*)&addr,sizeof(SOCKADDR)) == SOCKET_ERROR)
	{
		shutdown(svrSck,SD_BOTH);
		closesocket(svrSck);
		WSACleanup();
		LoadString ( hInstance , IDS_BIND_FAILED , szMessage , sizeof ( szMessage ) ) ;
		MessageBox ( hCurDlg , szMessage , szCaption , MB_ICONERROR ) ;
		ExitProcess ( EXIT_FAILURE ) ;
	}
	// start listening
	if( listen(svrSck,10) == SOCKET_ERROR )
	{
		closesocket ( svrSck ) ;
		LoadString ( hInstance , IDS_LISTEN_FALED , szMessage , sizeof ( szMessage ) ) ;
		MessageBox ( hCurDlg , szMessage , szCaption , MB_ICONERROR ) ;
		ExitProcess ( EXIT_FAILURE ) ;
	}

	state = TRUE ;
	hThread = CreateThread (NULL, 0, GetMessageFromClient, 0, 0, &ThreadID) ;
	while ( state ) // Wait for client connection
	{
		FD_ZERO(&rfd); // used for judging whether there is connection
		FD_ZERO(&efd); // used for judging whether there's any error
		FD_SET(svrSck,&rfd) ;
		FD_SET(svrSck,&efd) ;
		timeout.tv_sec=0 ;
		timeout.tv_usec=10000 ; // set timeout as 10 second
		if( select(0,&rfd,NULL,&efd,&timeout) )
		{
			if(FD_ISSET(svrSck,&rfd)) // if there's a connction
			{
				len = sizeof(SOCKADDR_IN);
				sck = accept(svrSck,(SOCKADDR*)&ad,&len);
				if( sck != INVALID_SOCKET )
				{
					GetLocalTime(&nowtime);
					set_client (&clt,sck,ad,"","","",TRUE,nowtime,NULL);
					ins_clients(clt);
					refresh( ) ;
				}
			}
			else if( FD_ISSET( svrSck,&efd ) ) // Something goes wrong
			{
				shutdown(svrSck,SD_BOTH);
				closesocket(svrSck);
				WSACleanup();
				LoadString ( hInstance , IDS_SOCKET_ERROR , szMessage , sizeof ( szMessage ) ) ;
				MessageBox ( hCurDlg , szMessage , szCaption , MB_ICONERROR ) ;
				ExitProcess ( EXIT_FAILURE ) ;
			}
		}
		Sleep(10);
	}
	TerminateThread ( hThread , 0 ) ;
	CloseHandle ( hThread ) ;
	hThread = NULL ;
	dst_clients( );
	shutdown(svrSck,SD_BOTH);
	closesocket(svrSck);
	WSACleanup();
	return 0L;
}