Symbian C/S »úÖÆ·ÖÎö
ÒÔÏ·ÖÎö»ùÓÚ£º
Developer Platform :S60 3rd Edition, Feature Pack 2 SDK
Operating System :Symbian OS v9.3
Ò»£¬ÎªÊ²Ã´ÒªÊ¹ÓÃClient/Server¼Ü¹¹
ÔÚSymibian OSÖÐËùÓеÄÒì²½·þÎñ¶¼ÊÇServerͨ¹ýC/S¼Ü¹¹À´ÊµÏֵġ£ClientÊÇÀûÓÃServerÌṩµÄÌض¨·þÎñµÄ³ÌÐò£¬Server½ÓÊÜÀ´ÖÁClientµÄÇëÇóÏûÏ¢²¢Í¬²½»òÒì²½µÄ´¦ÀíËûÃÇ¡£C/S¼Ü¹¹ÓÐÈçϵÄÓŵ㣺
1£¬¿ÉÀ©Õ¹ÐÔ
2£¬ÓÐЧÐÔ£ºÏàͬµÄServer¿ÉÒÔ·þÎñ¶à¸öClient¡£
3£¬°²È«ÐÔ£ºServerºÍClient´æÔÚÓÚµ¥¶ÀµÄ½ø³ÌÖУ¬²¢ÇÒͨ¹ýÏûÏ¢´«µÝ½øÐÐͨÐÅ¡£¾ßÓдíÎóÐÐΪClient²»»áʹËûµÄServer±ÀÀ££¨µ«ÊÇ£¬Server¿ÉÒÔͨ¹ý¿Í»§Ï̵߳ľä±úÀ´ÊǾßÓдíÎóÐÐΪµÄClient²úÉúÑÏÖØ´íÎ󣩡£
4£¬Òì²½ÐÔ£ºÔÚ·þÎñÆ÷Íê³ÉÇëÇóµÄʱºòʹÓÃAO»úÖÆÀ´Í¨ÖªËûµÄClient¡£Í¨¹ýAOÀ´¹ÒÆðÏ̶߳ø²»ÊÇÂÖѯÇëÇóµÄ״̬£¬SymbianOS¼õÉÙÁË´¦Àí¸ÃÇëÇóµÄ´¦ÀíÆ÷ÖÜÆÚ£¬´Ó¶ø½ÚÔ¼Á˵çÔ´£¬Õâ¶ÔÓÚÒƶ¯É豸À´ËµÊǷdz£ÖØÒªµÄ¡£
¶þ£¬Client/Server¼Ü¹¹µÄ´¦ÀíÁ÷³Ì
ClinetºÍServer´¦ÓÚ²»Í¬µÄ½ø³ÌÖУ¬ËûÃÇÎÞ·¨·ÃÎʱ˴˵ÄÐéµØÖ·¿Õ¼ä£¬ËùÒÔËûÃÇʹÓÃÏûÏ¢´«µÝÐÒéÀ´Í¨ÐÅ£¬ÕâÖÖͨÐŵÄÇþµÀ¾Í³ÆΪ»á»°¡£»á»°ÓÉÄں˴´½¨£¬Í¬Ê±Äں˻¹ÔÚËùÓеÄClient/ServerͨÐÅÖг䵱ý½é¡£
·þ Îñ£¬ÌرðÊÇϵͳÌṩµÄ·þÎñ£¬±ÈÈ磺Îļþ·þÎñ£¬´°¿Ú·þÎñºÍ×ÖÌåºÍλͼ·þÎñµÈ¶¼ÊÇÔÚϵͳÆô¶¯µÄʱºò¾ÍÆô¶¯ÁË¡£µ±È»Èç¹ûÊÇ×Ô¼º×öµÄserver¿ÉÒÔÔÚÐèÒªµÄʱ ºò£¬¼´µ±ÓÐclient·¢³öÇëÇóµÄʱºòÔÙÆô¶¯¡£È»ºó·þÎñÆ÷×èÈûÔÚij¸öµãÉÏ£¬µÈ´ýclientÇëÇóµÄµ½À´¡£ÔÚClient·¢³öÒ»¸öÇëÇóºó£¬·þÎñÆ÷»ánewÒ» ¸ö×ӻỰÀ´´¦ÀíÕâ¸öclientµÄÇëÇó£¬È»ºó×Ô¼ºÓÖ¼ÌÐø×èÈûÔÚ¼àÌýÇëÇóµÄµãÉÏ£¬ÒÔÂú×ãÆäËûClientµÄÇëÇó¡£Ã¿¸öClientºÍServerµÄºóÐø½»»¥ ¶¼ÊÇͨ¹ýÁ¬½ÓServerʱ´´½¨µÄSessionÀ´Íê³ÉµÄ¡£
Èý£¬RÀà½éÉÜ
C/S¼Ü¹¹Ãâ²»ÁËҪʹÓÃRÀ࣬ÄÇôʲôÊÇRÀàÄØ£¿ÕâÀïµÄ"R"ÊÇResourceµÄµÚÒ»¸ö×Öĸ£¬ÊÇ×ÊÔ´µÄÒâ˼¡£
1£¬¼ò½é
¾ßÓÐ"R"ǰ׺µÄÀà±íʾij¸ö×ÊÔ´µÄ¿Í»§¶Ë¾ä±ú¡£Ó¦ÓóÌÐòʵ¼ÊÉϲ¢²»ÓµÓÐ×ÊÔ´£¬×ÊÔ´ÓÉÉ豸ÉÏÒ»¸öSymbian OS ·þÎñÆ÷ËùÓµÓУ¬·þÎñÆ÷¹ÜÀí×ÊÔ´µÄʹÓ᣿ͻ§¿ÉÒÔʹÓÃÕâЩ¾ä±ú·ÃÎÊ·þÎñÆ÷¹ÜÀíµÄ×ÊÔ´£¬²¢ÇëÇóʹÓÃËüµÄ¹¦ÄÜ¡£
R ÀàûÓÐÈκι«¹²µÄ»ùÀ࣬ÓÐЩ·Ö¿éµÄÅÉϵÀ࣬±ÈÈ磬ÓÐЩÀàÊÇ´ÓRHandleBaseÅÉÉú—RFs£¬¶øÓеÄʲô¶¼²»ÊÇ—RWindowµÈ¡£Ò»°ãÀ´Ëµ£¬RÀàÊÇ ÔÚÕ»ÉÏʵÀý»¯»òÊÇǶÌ×ÔÚCÀàÖУ¬È»ºóͨ¹ýijÖÖ·½Ê½´ò¿ªËûÃÇ£¨Í¨³£Í¨¹ýÒ»¸ö·½·¨µ÷ÓÃÀ´´ò¿ª£¬ÀýÈçµ÷ÓÃOpen()»òConnect()£©¡£½áÊøʹÓÃËüÃÇʱ£¬ ÓбØҪʹ
Ïà¹ØÎĵµ£º
Ò» £º½â¾öC»òC++ÖеÄmultiple definition ofÎÊÌâ
server.cpp
clientp2p.cpp
#include "exception.h"
#include "clientp2p.h"
clientp2p.h
ÖÐдÓÐËùÓеÄÈ«¾Ö±äÁ¿¼°Æä³õʼ»¯Öµ
ºÍº¯ÊýÉùÃ÷
1.server.cppÖУº
ÒýÓÃ
£º
#include "clientp2p.h"
int Main(....)
{
...
}
2.clientp ......
curl c api
¹ØÓÚCurlµÄ½éÉܺܶ࣬ÕâÀï²»Ïêϸ½éÉÜ£¬Ö÷Ҫ̸һϼòµ¥Ó¦Óá£
×î½üÑо¿ÁËÒ»ÏÂLinuxϵÄcurl C API,curl c APIµÄÎĵµ±È½Ï·á¸»£¬Î¨Ò»¾ÍÊDzéÕÒÆðÀ´£¬·ÑЩʱ¼ä¡£CurlµÄC APIºÍcurlµÄPHP API£¬º¯Êý½Ó¿ÚºÍ×÷ÓôóÖÂÏàͬ£¬ËùÒÔÈç¹ûÓÐPHP APIʹÓþÑéÓ¦¸ÃºÜºÃÀí½â¡£
1£ºCURLcode curl_global_init(long flags);º¯ ......
ÔÚNotes µÄC/S ±à³ÌÖУ¬¾³£ÐèÒª¶ÔÒ»¸ö¼¯ºÏÖеĶÔÏó½øÐбéÀú´¦Àí£¬ÕâʱÈç¹ûÄÜÏÔʾһ¸ö½ø¶ÈÌõָʾµ±Ç°´¦Àí½ø³Ì£¬¾Í±È½ÏÖ±¹ÛÐÎÏ󣬿ͻ§½çÃæÒ²±È½ÏÓѺá£
1¡¢ÉùÃ÷APIº¯Êý
'ÉùÃ÷APIº¯Êý
Declare Function NEMProgressBegin Lib&nbs ......
ʱ³£ÔÚcppµÄ´úÂëÖ®Öп´µ½ÕâÑùµÄ´úÂë:
#ifdef __cplusplus
extern "C" {
#endif
//Ò»¶Î´úÂë
#ifdef __cplusplus
}
#endif
¡¡¡¡ÕâÑùµÄ´úÂëµ½µ×ÊÇʲôÒâ˼ÄØ£¿Ê×ÏÈ£¬__cplusplusÊÇcppÖеÄ×Ô¶¨Òåºê£¬ÄÇô¶¨ÒåÁËÕâ¸öºêµÄ»°±íʾÕâÊÇÒ ......
C³ÌÐòÊÇÓÉÒ»×é»òÊDZäÁ¿»òÊǺ¯ÊýµÄÍⲿ¶ÔÏó×é³ÉµÄ¡£ º¯ÊýÊÇÒ»¸ö×ÔÎÒ°üº¬µÄÍê³ÉÒ»¶¨Ïà¹Ø¹¦ÄܵÄÖ´ÐдúÂë¶Î¡£ÏÂÃæС±àºÍ´ó¼Ò·ÖÏíÏÂCÓïÑÔÖеĺ¯Êý¡£
1. gcvtº¯Êý
gcvtº¯ÊýµÄ¹¦ÄÜÊǰѸ¡µãÊýת»»³É×Ö·û´®£¬ÆäÓ÷¨ÊÇ£ºchar *gcvt(double value, int ndigit, char *buf);³ÌÐò ......