LinuxÏÂÏûÏ¢¶ÓÁкÍsocket¾ø¶ÔËٶȱÈÆ´
ÔÚµ±½ñµÄÍøÂçʱ´ú£¬ÎÒÃdz£³£¼ûµ½µÄ½ø³Ì¼äͨÐÅ·½Ê½¶¼ÊÇsocket£¬±ÈÈçJavaµÄEJBµ÷Óã¬JavaºÍCͨÐÅ£¬Web Service·þÎñµÈ¡£socketÊÇ×î³£ÓõÄͨѶ¼¼Êõ£¬¼¸ºõËùÓеÄϵͳ¡¢ÓïÑÔ¶¼Ö§³Ö£¬socketÒ²ÊÇÃæÏòÍøÂçµÄ£¬Í¨ÐŵÄÁ½·½¿ÉÒÔ¿çÔ½IPÍøÂç½øÐд«Êä¡£
ÔÚ±¾µØͨÐÅÖÐ(ͬһ̨»úÆ÷ÉϵĽø³Ì¼äͨѶ)£¬socketµÄÍøÂçÌØÐÔÈ´³ÉÁËÀÛ׸£¬×é×°½âÎöÍøÂ籨ͷ¡¢±¨ÎÄÈ·ÈÏ¡¢CRCУÑéµÈ¶¼ÊÇÕë¶ÔÍøÂçµÄ£¬±¾µØͨÐÅûÓбØÒª£¬·´¶ø»áÓ°Ïì´«ÊäЧÂÊ¡£±¾µØͨÐŵÄһЩ´«Í³¼¼Êõ£¬Èç¹ÜµÀ¡¢FIFO¡¢ÏûÏ¢¶ÓÁеȣ¬Ã»ÓÐÍøÂ繦Äܵĸºµ££¬´«ÊäËÙ¶ÈÓ¦¸Ã¸ßÓÚsocket£¬Äǵ½µ×¸ß¶àÉÙÒÔÖÁÓÚÖµµÃÔÚÓ¦ÓÃÖÐÌæ»»socket¼¼ÊõÄØ£¬½ñÌì¾ÍÀ´Ò»³¡Ð¡²âÊÔ£¬¾ÍSystem VÏûÏ¢¶ÓÁкÍsocketÖ®¼ä£¬×öÒ»´ÎÈ«ÃæµÄËٶȱÈÆ´¡£
±ÈÆ´³¡µØ£º
±¾È˵ıʼDZ¾£ºÈüÑï1.5G ÄÚ´æ1.5G
ϵͳ£ºUbuntu8.04 Desktop (Linux 2.6.24-24-generic)
JDK£º1.6
µÚÒ»»ØºÏ£º Java²âÊÔ
ÏÈ˵Ã÷һϣ¬Java²¢²»Ö§³ÖSystem VÏûÏ¢¶ÓÁУ¬Òò´ËÌØΪJavaÌṩÁËJNI½Ó¿Ú£¬ÎÒÃÇʹÓÃlajp_9.09ÌṩCÔ´Âë±àÒëµÄso¶¯Ì¬Á¬½Ó¿â£¬lajpµÄÏÂÔصØÖ·ºÍÎĵµ£ºhttp://code.google.com/p/lajp/
Ê×ÏÈÉϳ¡µÄÊÇSystem VÏûÏ¢¶ÓÁС£
·¢ËͶ˳ÌÐò:
001 package test;
002
003 import lajp.MsgQ;
004
005 public class TestSend
006 {
007 /** ÏûÏ¢¶ÓÁÐKEY */
008 static final int IPC_KEY = 0x20021230;
009
010 static
011 {
012 //JNI
013 System.loadLibrary("lajpmsgq");
014 }
015
016 public static void main(String[] args)
017 {
018 //´´½¨»ò»ñµÃÏÖÓеÄÏûÏ¢¶ÓÁÐ
019 int msqid = MsgQ.msgget(IPC_KEY);
020 //·¢ËÍ×Ö½ÚÊý×é
021
Ïà¹ØÎĵµ£º
Ê×ÏÈÏÂÔØÒ»¸ögrubfordos£¬´ÓÕâÀïϾÍÊÇÁË£¬http://download.csdn.net/source/1326121
ºÜСµÄ£¬²Å190k×óÓÒ£¬Ö±½Ó·ÅÖÃÔÚcÅÌ£¬È»ºó£¬´ò¿ªcÅÌ£¬ÔÚÎļþ¼ÐÑ¡ÏîÀïÃ棬°ÑϵͳÒþ²ØÑ¡Ïî´ò¿ª£¬ÏµÍ³±£»¤ÎļþÒ²´ò¿ª£¬¾Í¿ÉÒÔ¿´µ½Ò»¸öboot.iniÎļþ£¬ÔÚboot.iniÀïÃæÌí¼ÓÒ»C£º\grldr="grub for dos"
OK ¡£
Æô¶¯Ã»ÓÐÎÊÌâÁË¡£
°ÑlinuxµÄ°²× ......
Linux JDK and ANT install
linux JDKµÄ°²×°
°²×°JDK
´ÓsunÍøÕ¾ÉÏÖ±½ÓÏÂÔØJDK£ºhttp:
//java.sun.com/j2se/1.4.2
/download.htmlÌṩÁËÁ½¸öÏÂÔØ£º
1¡¢RPM in self-extracting file
(j2sdk-1_4_2_04-linux-i586.bin,
32.77 MB) Õâ¸öÊÇ×Ô½âѹµÄÎļþ£¬ÔÚlinuxÉÏ°²×°ÈçÏ£º
chmod u+x
./j2sdk-1_4_2_04-l ......
LinuxÌṩÁË´óÁ¿µÄÃüÁÀûÓÃËü¿ÉÒÔÓÐЧµØÍê³É´óÁ¿µÄ¹¤×÷£¬Èç´ÅÅ̲Ù×÷¡¢Îļþ´æÈ¡¡¢Ä¿Â¼²Ù×÷¡¢½ø³Ì¹ÜÀí¡¢ÎļþȨÏÞÉ趨µÈ¡£ËùÒÔ£¬ÔÚLinuxϵͳÉϹ¤×÷Àë²»¿ªÊ¹ÓÃϵͳÌṩµÄÃüÁî¡£ÒªÏëÕæÕýÀí½âLinuxϵͳ£¬¾Í±ØÐë´ÓLinuxÃüÁîѧÆð£¬Í¨¹ý»ù´¡µÄÃüÁîѧϰ¿ÉÒÔ½øÒ»²½Àí½âLinuxϵͳ¡£
²»Í¬Linux·¢ÐаæµÄÃüÁîÊýÁ¿²»Ò»Ñù£¬µ«Linux·¢ÐÐ°æ± ......
Ò»¡¢forkÈëÃÅ֪ʶ
ÏÈ¿´Ò»¸öÀý×Ó£º
/*
* fork_test.c
* version 1
* Created on: 2010-5-29
* Author: wangth
*/
#include <unistd.h>;
#include <stdio.h>
int main ()
{
pid_t fpid; //fpid±íʾforkº¯Êý·µ»ØµÄÖµ
//´Ëʱ½öÓÐÒ»¸ö½ ......