¡¾ÀíÂÛ֪ʶƪ¡¿Linux»ìºÏ±à³Ì+log4cpp
ÓÉÓÚҪʹÓõ½log4cppµÄ¿â£¬¶ølog4cµÄ×ÊÁÏÊǷdz£µÄÉÙ£¬Ò²ÀÁµÃÈ¥Ñо¿ËüµÄÓ÷¨£¬ÓÚÊǾ;ö¶¨ÊÔÊÔ»ìºÏ±à³ÌÕßÍæÒâ¡£
Ê×ÏÈÏÈÒýÓÃÏÂC++ËüµÄfather: StroustrupµÄһƪÎÄÕ¡¶C++ Style and Technique FAQ¡·£¨http://www2.research.att.com/~bs/bs_faq2.html£©ÀïµÄһС¸öƬ¶Î£º
Just declare the C function ``extern "C"'' (in your C++ code) and call it (from your C or C++ code). For example:
// C++ code
extern "C" void f(int); // one way
extern "C" { // another way
int g(double);
double h();
};
void code(int i, double d)
{
f(i);
int ii = g(d);
double dd = h();
// ...
}
The definitions of the functions may look like this:
/* C code: */
void f(int i)
{
/* ... */
}
int g(double d)
{
/* ... */
}
double h()
{
/* ... */
}
Note that C++ type rules, not C rules, are used. So you can't call function declared ``extern "C"'' with the wrong number of argument. For example:
// C++ code
void more_code(int i, double d)
{
double dd = h(i,d); // error: unexpected arguments
// ...
}
Just declare the C++ function ``extern "C"'' (in your C++ code) and call it (from your C or C++ code). For example:
// C++ code:
extern "C" void f(int);
void f(int i)
{
// ...
}
Now f() can be used like this:
/* C code: */
void f(int);
void cc(int i)
{
f(i);
/* ... */
}
Naturally, this works only for non-member functions. If you want to call member functions (incl. virtual functions) from C, you need to provide a simple wrapper. For example:
// C++ code:
class C {
// ...
virtual double f(int);
};
extern "C" double call_C_f(C* p, int i) // wrapper function
{
return p->f(i);
}
Now C::f() can be used like this:
/* C code: */
double call_C_f(struct C* p, int i);
void ccc(struct C* p, int i)
{
double d = call_C_f(p,i);
/* ... */
}
If you want to call overloaded functions from C, you must provide wrappers with distinct names for th
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
linuxÍøÂç²ÎÊýÖ÷ҪλÓÚÏÂÃæÁ½¸öĿ¼ÏÂ:/proc/sys/net/core/ºÍ/proc/sys/net/ipv4/, ÏÂÃæ·Ö±ð¶ÔÕâÁ½¸öĿ¼Ï³£ÓõöÍøÂç²ÎÊý×öÏÂ˵Ã÷:
1./proc/sys/net/core/
$ /proc/sys/net/core/somaxconn
listen()µÄĬÈϲÎÊý,¹ÒÆðÇëÇóµÄ×î´óÊýÁ¿.ĬÈÏÊÇ128.¶Ô·±Ã¦µÄ·þÎñÆ÷,Ôö¼Ó¸ÃÖµÓÐÖúÓÚÍøÂçÐÔÄÜ, ¿É²Î¿¼µÄÓÅ»¯Ö ......
·½·¨Ò»¡¢LR + SiteScope
·½·¨¶þ¡¢Ê¹ÓÃrstatd°ü
1¡¢ÏÂÔØrpc.rstatd-4.0.1.tar.gz
2¡¢½âѹËõ
tar -zxvf rpc.rstatd-4.0.1.tar.gz
3¡¢ÅäÖÃ
./configure
4¡¢±àÒë
make
5¡¢°²×°
make install
6¡¢Æô¶¯
rpc.rstatd
7¡¢ÔÚLoadRunnerÖÐÌí¼Ó¼ÆÊýÆ÷
average load :ÔÚ¹ýÈ¥µ ......
Linux Socket ѧϰ£¨Ê®£©
ÔÚÌ×½Ó¿ÚÉÏʹÓñê×¼I/O
ÔÚÇ°ÃæÕ½ڵÄÀý×Ó´úÂëÖÐÎÒÃÇÒѾʹÓÃÁËread(2)»òÊÇwrite(2)ϵͳµ÷ÓÃÔÚÌ×½Ó¿ÚÉÏÖ´ÐжÁÈ¡ºÍдÈë²Ù×÷¡£Õâ¸ö¹æÔòµÄÒ»¸öÀýÍâ¾ÍÊÇrecvfrom(2)ºÍsendto(2)º¯Êý£¬ÕâÁ½¸öº¯ÊýÓÃÀ´¶ÁдÊý¾Ý±¨¡£È»¶ø£¬Ê¹ÓÃreadºÍwritteº¯Êýµ÷ÓÃÈ´ÓÐһЩ³ÌÐòÉϵÄȱµã¡£
ÕâÒ»ÕÂÎÒÃǽ«»áÌÖÂÛÒÔÏÂÄÚÈÝ ......
linux²Ã¼ôºÃºó£¬ÏÂÃæ½ô¸ú×ÅÎҾͽ¨Á¢Í¼Ðο⡣ͼÐοâµÄÒÆÖ²Ïà¶ÔÀ´Ëµ±È½Ï·±Ëö¡£ÒòΪÔÚÏàͬӲ¼þ½á¹¹µÄÇé¿öÏÂÊÇ¿ÉÒÔÖ±½Ó¿½±´¹ýÀ´µÄ¡£Îҵķ½·¨ÊÇÏȰÑͼÐοâ×îÖ÷ÒªµÄ³ÌÐòxinit¿½¹ýÀ´£¬È»ºóÔËÐÐËü¸ù¾ÝÈÕÖ¾ÌáʾȱÉÙÊ²Ã´Ò»Ò»ÒÆÖ²¹ýÀ´¾Í¿ÉÒÔÁË¡£Ò»Ð©¿âÎļþºÍһЩ×ÖÌåÅäÖã¬ÊäÈëÊä³öÉ豸µÄÇý¶¯¿½±´¹ýÀ´¾Í¿ÉÒÔÁË£¬µ±È»ÄÚºËÅäÖÃÀïµÄframeb ......