linux epollÓÃÓÚsocket¿ØÖÆ ´úÂëʵÀý
¹ØÓÚepollʹÓ÷½·¨£º
²ÎÕÕ£º http://linux.die.net/man/4/epoll
ʵÀý´úÂ룺£¨À´×ÔÍøÉÏijÂÛ̳£©
#include <pthread.h>
#include <stdio.h>
#include <sys/timeb.h>
#include <sys/socket.h>
#include <sys/types.h>
#include <sys/wait.h>
#include <sys/epoll.h>
#include <netinet/in.h>
#include <string.h>
#include <fcntl.h>
#include <signal.h>
#include <errno.h>
#define MAX_CLIENT 101
#define PORT 3355
#define DEBUG
int listenfd;
//ÉèÖÃsocketÁ¬½ÓΪ·Ç×èÈûģʽ
void nonblock(int sockfd)
{
int opts;
opts = fcntl(sockfd, F_GETFL);
if(opts < 0)
{
perror("fcntl(F_GETFL)\n");
exit(1);
}
opts = (opts | O_NONBLOCK);
if(fcntl(sockfd, F_SETFL, opts) < 0)
{
perror("fcntl(F_SETFL)\n");
exit(1);
}
}
int main()
{
int epfd;
struct epoll_event *events;
struct epoll_event ev;
struct sockaddr_in srv;
int clifd;
int i;
int n;
int res;
char buffer[1024];
//´´½¨·þÎñÆ÷¶Ësocket
if( (listenfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
{
perror("sockfd\n");
exit(1);
}
bzero(&srv, sizeof(srv));
srv.sin_family = AF_INET;
srv.sin_addr.s_addr = htonl(INADDR_ANY);;
srv.sin_port = htons(PORT);
//·
Ïà¹ØÎĵµ£º
1. HCI²ãÐÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI) ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈÐÒé ......
ÎÒÊÇ KDE Fans¡£ËùÒÔ£¬¿ÉÄÜÒÔÏ»á³öÏַdz£Ö÷¹ÛµÄ¹Ûµã¡£µ«ÊÇ£¬ÎÒ³ÐÈÏÎÒ²»¼«¶Ë~
Linux ϵÄÎÄÕÂÒ»´ó¶Ñ¶¼ÊÇ GNOME ÏÂÄ£·Â Mac£¬µ«ÊÇÔõÑùÄ£·Â¶¼¸Ð¾õ²»Í¬£¬±Ï¾¹²»Í¬¾ÍÊDz»Í¬~
²»È粻ҪһζµØ³ÁË~ ÏàËÆÒ²¿ÉÒÔ°¡~ ÕâÑù¼ÈÓÐÌØÉ«ÓÖÓÐÃÀ¸Ð~
³ýÁË GNOME Ï嵀 Mac4Lin »¹Óкܲ»´íµÄ Elemetary¡£ÕâÁ½¸ö¶¼Êdz£¼ûµÄ GNOME ·Â Mac µÄ ......
ËäÈ»ÎÒÃÇϰ¹ßÓÚlinuxÏÂÃüÁîÐвÙ×÷,µ«Êǰ²×°Ä³Ð©Èí¼þ±ØÐëÊÇ»ùÓÚGUIÏÂÃæµÄ,Õâ¸öʱºò×ܲ»ÄÜÅܵ½»ú·¿È¥°²×°°É,µ«ÎÒÃÇ¿ÉÒÔʹÓÃXmanagerÈí¼þʵÏÖ¶Ôlinux½øÐÐÔ¶³Ì¿ØÖÆ.
µÚÒ»²½£¬ÎÒÃÇÔÚ
LINUX
ϵͳÏ£¬ÐÞ¸Ä
/etc/X11/xdm/Xaccess
Îļþ£¬ÕÒµ½ÏÂÃæÓï¾ä£º
# *# any host can get a login window
È¥µô×îÇ°ÃæµÄ
#
ºÅ ......
ƽ»¬Ç¨ÒƵļ¼Çɺͼ¼Êõ
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt="" width="16"
heig ......
¹«Ë¾Linux·þÎñÆ÷ÖØÆôºó£¬ÍøÂç²»ÄÜÕý³£Á¬½Ó£¬ÎÒͬÊÂÕÒµ½Á˽â¾ö·½·¨£¬ÎÒÔÚÕâÀï·ÖÏíһϡ£
ÍøÂç²»ÄÜÕý³£Á¬½Ó£¬ÊÇÒòΪûÓÐÕýÈ·¼ÓÔØLinuxÍø¿¨Çý¶¯£¬½â¾ö·½·¨Îª£º
ÓÃrootÓû§µÇ¼ϵͳºó£¬ÒÀ´ÎÖ´ÐÐÈçÏÂÃüÁî
cd /lib/modules/[°æ±¾ºÅ]/kernel/drivers/net   ......