Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

linux socketѧϰ±Ê¼Ç£¨µÚÈýÕ£©


  IPµØÖ·ÊÇÒ»¸ö32λµÄ¶þ½øÖÆÊý£¬ËüÓɵã·ÖÊ®½øÖƼǷ¨±íʾ£¬Ã¿Ò»¸öÊ®½øÖÆÊý´ú±íÒ»¸ö8λÎÞ·ûºÅÕûÐÍÊý£¬ËùÒÔ·¶Î§ÔÚ0-255Ö®¼ä¡£
Ò»¸öIPµØÖ··ÖΪÍøÂçµØÖ·ºÍÖ÷»úµØÖ·£¬ÍøÂçµØÖ·Çø·Ö²»Í¬ÍøÂ磬Ö÷»úµØÖ·Çø·ÖÏàͬÍøÂçÖв»Í¬Ö÷»ú¡£²»Í¬µÄIPµØÖ·ÀàËûÃǵÄÖ÷»úÍøÂçµØÖ·Ò²ÊDz»¹Ì¶¨µÄ£¬A,B,CÀàµØÖ·¶¨ÒåÁËijһÖ÷»úÌض¨µÄIPµØÖ·£¬DÀàΪ×é²¥µØÖ·£¬EÀàΪ±£Áô½ñºóËùÓ᣾ßÌåµÄ»®·ÖÊÇ£º           ·ÖÀà ×îµÍ ×î¸ß ÍøÂçλ Ö÷»úλ
A 0.0.0.0 127.255.255.255 7 24
B 128.0.0.0 191.255.255.255 14 16
C 192.0.0.0 223.255.255.255 21 8
D 224.0.0.0 239.255.255.255 28 N/A
E 240.0.0.0 247.255.255.255 27 N/A       
ÍøÂçÑÚÂëµÄ×÷ÓÃÔÚÓÚ°ÑÍøÂçµØÖ·´ÓIPµØÖ·ÖÐÌáÈ¡³öÀ´£¬Êµ¼ÊÉÏ´ú±íÍøÂçÑÚÂëµÄIPºÅÓëijһÌض¨µÄIPµØÖ·½øÐГ°´Î»Ó딡£            ·ÖÀà ×îµÍ ×î¸ß ÍøÂçÑÚÂë
A 0.0.0.0 127.255.255.255 24
B 128.0.0.0 191.255.255.255 16
C 192.0.0.0 223.255.255.255 8
ÒÔÏÂÊǶÔIPµØÖ·½øÐмì²éºÍ·ÖÀàµÄÔ´´úÂë
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
int main(int argc, char **argv)
{
int x;
struct sockaddr_in adr_inet;
int len_inet;
unsigned msb;
char class;
char *netmask;
static struct {
unsigned char ip[4];
} addresses[] = {
{ {
44, 135, 86, 12}}, { {
127, 0, 0, 1}}, { {
172, 16, 23, 95}}, { {
192, 168, 9, 1}},};
for (x = 0; x < 4; ++x) {
memset(&adr_inet, 0, sizeof(adr_inet));
adr_inet.sin_family = AF_INET;
adr_inet.sin_port = htons(9000);
memcpy(&adr_inet.sin_addr.s_addr, addresses[x].ip, 4);
len_inet = sizeof(adr_inet);
msb = *(unsigned char *) &adr_ine


Ïà¹ØÎĵµ£º

LinuxÖеÄÄÚ´æ·ÖÅäºÍÊÍ·ÅÖ®__free_pages()º¯Êý·ÖÎö

  ¼ÇµÃÎÒÃÇÔÚÉÏƪÎÄÕÂmem_init()·ÖÎöÖÐÌáµ½__free_page()º¯ÊýÂð£¿ÎÒÃÇÏÖÔÚÀ´ÍêÉÆËü¡£ËüµÄµ÷Óùý³ÌÊÇÕâÑùµÄ£ºmem_init()->free_all_bootmem_node():ÎÒÃÇÖªµÀÕâ¸öº¯ÊýÊÇͳ¼ÆÒ»¹²ÊÍ·ÅÁ˶àÉÙ¿ÕÏÐÒ³¡£->free_all_bootmem_core()¾ÍÊÇÔÚÕâ¸öº¯ÊýÀïÃæÏȺó¶à´Îµ÷ÓÃ__free_pages()º¯Êý¡£Ä¿µÄ¾ÍÊÇΪÁËÊÍ·Åÿ¸öÄÚ´ænodeÀïÃæÎ ......

LinuxÅäÖÃjava¿ª·¢Æ½Ì¨

LinuxÅäÖÃjava¿ª·¢Æ½Ì¨
Ò»¡¢°²×°jdk
1.ÏÂÔØ°²×°jdk
£¨1£©¡¢Ê×ÏÈ£¬ÔÚhttp://java.sun.com
ÕÒµ½ÒªÏÂÔصÄjdk£¬ÏÂÔØ×Ô¼ºÐèÒªµÄjdk°æ±¾¡£ÎÒÕâÀïʹÓõÄÊÇjdk6£¬µÃµ½µÄÊÇÒ»¸öÃûΪjdk-6u6-linux-i586-rpm.binµÄÎļþ¡£´ËÎļþµ±Ç°Îª²»¿ÉÔËÐеÄshell script¡£
£¨2£©¡¢¸ü¸ÄȨÏÞ£¬ÌáÈ¡jdk°²×°Îļþ£º
   ´ò¿ªÖÕ¶ËÔËÐ ......

ÕûÀíÁËһЩ³£ÓõÄLinuxÃüÁî

ÕûÀíÁËһЩ³£ÓõÄLinuxÃüÁî
http://jythoner.javaeye.com/blog/290976
¹Ø¼ü×Ö: linux
1.²é¿´ÏµÍ³ÄÚºË
#uname -a
2.²é¿´cpuÐÅÏ¢
#cat /proc/cpuinfo
3.²é¿´ÄÚ´æʹÓÃÇé¿ö
#free -m
4.²é¿´Ó²ÅÌÊ£Óà¿Õ¼ä
#df -h
5.²é¿´Ä¿Â¼Õ¼Óÿռä
#du -hs Ŀ¼Ãû
6.²é¿´µ±Ç°ÓÐÄÄЩ½ø³Ì
#ps -A
7.²é¿´µ±Ç°½ø³ÌµÄʵ ......

linuxѧϰ±Ê¼ÇÖ®£¨ÈëÃÅlinuxÎļþϵͳ£©

bin£º¸ÃĿ¼´æ·Å×î³£ÓõĻù±¾ÃüÁ±ÈÈ翽±´ÃüÁîcp¡¢±à¼­ÃüÁîvi¡¢É¾³ýÃüÁîrmµÈ¡£
boot:¸ÃĿ¼°üº¬ÁËϵͳÆô¶¯ÐèÒªµÄÅäÖÃÎļþ¡¢Äںˣ¨vmliuxz£©ºÍϵͳ¾µÏñ(initrd….img)µÈ¡£
dev£º¸ÃĿ¼Ï´æ·ÅµÄÊÇLinuxÖÐʹÓûòδʹÓõÄÍⲿÉ豸Îļþ£¨fd´ú±íÈíÅÌ£¬hd´ú±íÓ²Å̵ȣ©£¬Ê¹ÓÃÕâЩÉ豸Îļþ¿ÉÒÔÓòÙ×÷ÎļþµÄ·½Ê½²Ù×÷É豸¡£ ......

Linux/Unixϸ÷ÖÖѹËõÎļþµÄѹËõ/½âѹ·½·¨

1. gzÎļþ
ÕâÖÖÎļþ¿ÉÒÔʹÓÃgzip¡¢gunzip¡¢zcat½øÐнâѹ£º
gzip -d file_name
gunzip -d file_name
zcat file_name
2. tar.gz¡¢tgzÎļþ
ÕâÖÖѹËõÎļþʹÓýâѹÃüÁîºÍtarÃüÁîÅäºÏʹÓã¬È磺
gzip -d file_name.tar.gz
gunzip -d file_name.tgz
zcat file_name
È»ºóÖ´ÐУº
tar xvf file_name.tar
ijЩ°æ±¾µÄt ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ