Enabling broadcast option on a socket!

In order to enable broadcasting option on a socket you’ve got to enable it via a call to setsockopt with optname set to SO_BROADCAST and level set to SOL_SOCKET! Here is a function which does this! [sourcecode language=’cpp’]bool SetBroadcastOn( const bool Enable ) {     const BOOL bEnable = Enable;     if( setsockopt( sckHandle,                     […]
Continue reading…

 

Charizing operator (Microsoft specific)!

You’ve heard of stringizing pre-processor operators, ever heard of charizing operators? Very similar to stringizing operators, except that it puts single quotes around it’s arguments, that’s why it’s called the charizing operator! For stringizing we use “#” operator but for charizing we use “#@”. Here is an e.g. From MSDN: [sourcecode language=’cpp’]#define MakeChar( ch ) […]
Continue reading…