LinuxÏÂʵÏÖRPC±à³Ì
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.Éú³ÉMakefile
$rpcgen -Sm test.x>Makefile
5.±à¼Ô´Îļþ£¬¼ÓÈëÄãÏëÒªµÄ·þÎñµÈ
6.±à¼Makefile,ÕâºÜÖØÒª£¡
7.Ö´ÐвâÊÔ
ÎÊÌ⣺
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
ÏÂÃæÊÇ¿ª·¢Ò»¸örpc³ÌÐòµÄ¾ßÌåÁ÷³Ì£¬Ïê¼û
http://zhoulifa.bokee.com/6128714.html
ÎÒÔÚ±à³ÌÖÐÓöµ½ÒÔϼ¸¸öÎÊÌ⣺
1.MySQLÊý¾Ý¿â´íÎó
1£©±¨¸æÁ¬½Ó²»ÉÏMySQL£¬´úÂëÈçÏÂ
if(mysql_real_connect(conn,"127.0.0.1","root","password",
"database",0,NULL,0)){
fprintf(stderr,"%s\n%s\n",mysql_error(conn),
"Êý¾Ý¿âÁ¬½Óʧ°Ü");
exit(1);
}
ÔÒòÈçÏ£ºÅжÏÓï¾ä´íÎó£¬Ó¦¸ÃΪif(mysql_real_connect(conn,...)==NULL){
...
}
2.¸üÐÂÊý¾Ýʧ°Ü
char *sql="update test_table set balance=1000 where id=1000";
result=mysql_query(conn,sql);
if(result==NULL){
.....
/*´íÎó*/
}
ÔÒòÈçÏ£º»¹ÊÇÅжÏÓï¾ä´íÎó£¬ÓÉÓÚ¸üвÙ×÷²»Ïò²éѯ
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
ÏȼòÒª½éÉÜÏÂddµÄ²ÎÊý£¬ºó±ßͨ¹ý¼¸¸öʵÀý½éÉÜddµÄÓ¦Ó㬲ο¼ÁËÆäËûÍøÓѵÄ×ÊÁÏ£¬ÔÚ´ËÒ»
²¢¸Ðл£¬Ë®Æ½ÓÐÏÞÎÄÖÐÓÐʲô´íÎóÇë´ó¼ÒÖ¸Õý¡£
dd ÊÇ Linux/UNIX ϵÄÒ»¸ö·Ç³£ÓÐÓõÄÃüÁ×÷ÓÃÊÇÓÃÖ¸¶¨´óСµÄ¿é¿½±´Ò»¸öÎļþ£¬²¢ÔÚ¿½±´
µÄͬʱ½øÐÐÖ¸¶¨µÄת»»¡£
1. ÃüÁî¼ò½é
dd µÄÖ÷ҪѡÏ
Ö¸¶¨Êý×ֵĵط½ÈôÒÔÏÂÁÐ×Ö·û½áβ³ËÒÔÏ ......
ÕÆÎÕ¸÷linux ³£ÓÃÃüÁîµÄʹÓÃ
¶þ¡¢ÊµÑé²½Öè¼°½á¹û·ÖÎö
ÒªÇ󣺽«ÊµÑé»ñµÃµÄ½á¹û½øÐÐÃèÊö£¬»ù±¾ÄÚÈݰüÀ¨£º
1. ´ò¿ªlinuxϵͳ,½øÈëÓû§µÇ¼½çÃæ,Èçͼ1
2. ÊäÈëÓû§ÃûºÍÃÜÂë¾Í¿ÉÒÔ½øÈëÎı¾×Ö·û²Ù×÷½çÃæÁ ......
½ø³ÌÊÇϵͳÖгÌÐòÖ´ÐкÍ×ÊÔ´·ÖÅäµÄ»ù±¾µ¥Î»¡£Ã¿¸ö½ø³Ì¶¼ÓÐ×Ô¼ºµÄÊý¾Ý¶Î£¬´úÂë¶ÎºÍ¶ÑÕ»¶Î£¬Õâ¾Íµ¼ÖÂÁ˽ø³ÌÔÚ½øÐÐÇл»µÈ²Ù×÷Æðµ½ÁËÏÖ³¡±£»¤×÷Óᣵ«ÊÇΪÁ˽øÒ»²½¼õÉÙ´¦Àí»úµÄ¿Õתʱ¼äÖ§³Ö¶à´¦ÀíÆ÷ºÍ¼õÉÙÉÏÏÂÎÄÇл»¿ªÏú£¬½ø³ÌÑÝ»¯ÖгöÏÖÁËÁíÍâÒ»¸ö¸ÅÄÕâ¾ÍÊÇỊ̈߳¬Ò²±»È˳ÆÎªÇáÁ¿¼¶µÄ½ø³Ì¡£ËüÊÇÒ»¸ö½ø³ÌÄڵĻù±¾µ÷¶Èµ¥ ......