LinuxÏÂRPCµÄhello world
Linux ÏÂÃæʹÓÃRPCÐèҪʹÓõ½ÃüÁîrpcgen.
ÔÚLinuxÏ¿ª·¢RPC³ÌÐòÁ÷³ÌÈçÏ£º
1.дһ¸örpc³ÌÐò£¬
Èçtest.x
2.ʹÓÃrpcgenÉú³É±ØÐëµÄÎļþ£¬Í¨³£ÊÇ¿Í»§¶ËºÍ·þÎñÆ÷¶ËÒÔ¼°Í·Îļþ
$rpcgen test.x
3.ʹÓÃrpcgenÉú³É·þÎñÆ÷¶ËºÍ¿Í»§¶ËµÄCÓïÑÔ´úÂë
$rpcgen -Ss -o test_server.c test.x
$rpcgen -Sc -o test_client.c test.x
4.±à¼Ô´Îļþ£¬¼ÓÈëÄãÏëÒªµÄ·þÎñµÈ
5.ʹÓÃgcc±àÒëÉú³É¿ÉÖ´ÐÐÎļþ
$gcc -Wall -o test_server test_server.c test_clnt.c test_srv.c
$gcc -Wall -o test_client test_clnt.c test_client.c
6.ʹÓÃrpcgenÉú³ÉMakefile
$rpcgen -Sm test.x>Makefile
7.Ö´ÐвâÊÔ
$./test_server
$./test_client 127.0.0.1
ÎÊÌ⣺
1.·þÎñÆ÷ÎÞ·¨Æô¶¯£¬´íÎóÈçÏ£º
Cannot register service: RPC: Unable to receive; errno = Connection refused
unable to register (TESTPROG, VERSION, udp).
½â¾ö·½·¨£ºÏµÍ³Ã»Óа²×°portmap»òÕßûÓÐÆô¶¯portmap¶Ë¿ÚÓ³Éä¡£
$ls /etc/init.d/
Èç¹ûûÓÐportmapÔò°²×°Ö®
$sudo apt-get install portmap
Èç¹ûÓÐÁË£¬ÔòÆô¶¯
$sudo /etc/init.d/portmap start
»¹¿ÉÒÔʹÓÃchkconfigÉèÖÃϵͳ¿ª»úÆô¶¯µÄ·þÎñÏÈ罫portmap¼ÓÈ뿪»úÆô¶¯£º
$sudo chkconfig --level 2 -s portmap on
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌṩÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
LinuxϵͳÏÂʹÓÃUSBת´®¿ÚÁ¬½Ó¹¤ÒµÉ豸 ÔÚWindowsÏ¿ÉÒÔʹÓ󬼶ÖÕ¶ËÀ´Á¬½Ó½»»»»úºÍ·ÓÉÆ÷µÈ¹¤ÒµÉ豸£¬¶øÇÒÔÚWindowsÏÂʹÓÃusbת´®¿ÚµÄÏßÒ²ÓÐÏàÓ¦µÄÇý¶¯£¬µ«ÊÇÈçºÎÔÚLinuxÏÂʹÓÃÄØ£¿
¡¡¡¡Ê×ÏÈÒªÓÐÒ»¸öLinuxϵÄÖÕ¶ËÈí¼þ½ÐminicomÈç¹ûûÓÐ×°Õâ¸öµÄÅóÓÑ¿ÉÒÔµ½×Ô¼ºµÄÔ´ÖÐÈ¥ÏÂÔØ£¬È»ºóÄã¾ÍÒª²åÉÏÄãµÄusbת´®¿ÚµÄÏߣ¬ÔÚ ......
sys_execve
| - do_execve
|
| - search_binary_handler
|- linux_binfmt= elf_format
|- elf_format-> load_elf_binary
| -&nbs ......