Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

FLASH°²È«É³Ïä·þÎñÆ÷¶Ë³ÌÐò´úÂë(¿çƽ̨,C++/JAVA)

Main.cpp  (Win/*nix)
#include "FlexSecurityBox.h"
int main(int argc, char ** argv) {

char * address;
short port;
if (argc == 2)
{
address = "0.0.0.0";
port = atoi(argv[1]);
} else if (argc == 3)
{
address = argv[1];
port = atoi(argv[2]);
} else
{
printf("You have not to set listening port, we set default port is 843.\n");
address = "0.0.0.0";
port = 843;
}
FlexSecurityBox flexsecuritybox(address, port);
if (!flexsecuritybox.Open() )
{
printf("Socket Initialize Error");
exit(-1);
}
else
flexsecuritybox.DoWork();


FlexSecurityBox.h  (Winƽ̨)
#ifndef _FLEXSECURITYBOX_H
#define _FLEXSECURITYBOX_H
#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#pragma comment(lib,"ws2_32.lib")
class FlexSecurityBox
{
private:
const char * ListenAddress;
const short Port;
bool IsOpened;
SOCKET sockSrv;
SOCKET sockConn;
SOCKADDR_IN addrSrv;
public:
FlexSecurityBox(const char * listenAddress, const short port) : ListenAddress(listenAddress), Port(port), IsOpened(false)
{

}
bool Open()
{
WORD wVersionRequested;
WSADATA wsaData;
int err;
wVersionRequested = MAKEWORD( 1, 1 );
err = WSAStartup( wVersionRequested, &wsaData );//³õʼ»¯Ì×½Ó×Ö
if ( err != 0 )
{
return IsOpened = false;
}
if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 )
{
WSACleanup( );
return IsOpened = false;
}
if ((sockSrv = socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
printf("Socket create error!\n");
return IsOpened = false;
}
addrSrv.sin_addr.S_un.S_addr = htonl(INADDR_ANY);
addrSrv.sin_family = AF_INET;
addrSrv.sin_port = htons(Port);
if (strcmp(ListenAddress, "0.0.0.0"))
{
struct hostent * hostname = gethostbyname(ListenAddress);
if (hostname != 0)
memcpy(&addrSrv.sin_addr.s_addr, hostname->h_addr_list[0], hostname->h_length);
}
if (bind(so


Ïà¹ØÎĵµ£º

C++Öд¦ÀíXMLÎļþ

дUnmanaged CodeÔÚ.NETʱ´ú³ÉΪһÖֺܱ¯²ÒµÄÊ£¬µ±ÄãÐèÒª´¦ÀíXMLÎļþʱ£¬ÕâÖָоõ»á±äµÃÓÈÆäÇ¿ÁÒ¡£FCLÖеÄSystem.XML¶à¼òµ¥°¡£¬Á¬Steve Ballmer¶¼ÖªµÀÔõôÓá£
ÊÂÇé²»»á×ÜÊÇÄÇôÀíÏëµÄ£¬¼ÙÈçÄãÒªÔÚC/C++³ÌÐòÀï´¦ÀíXMLÔõô°ìÄØ£¿
Ñ¡ÔñÒ»£ºÊÐÃæÉϵÄXML lib»¹ÊÇÓм¸¸öµÄ£¬×îÓÐÃûµÄµ±È»ÊÇlibXML¡£ÎÒÒ»ÄêÇ°Óùý£¬ºÜ²»´í£¬ÎÒ»¹ ......

¡¾C/C++¡¿ÍƼöµÄC++Êé¼®ÒÔ¼°ÔĶÁ˳Ðò


µ±¶ÁÕßÓÐÒ»¶¨c/c++»ù´¡
ÍƼöµÄÔĶÁ˳Ðò:
level 1
´Ó<<essential c++>>¿ªÊ¼£¬¶ÌС¾«º·£¬¿ÉÒÔ¶Ôc++ÄܽøÒ»²½Á˽âÆäÌØÐÔ
ÒÔ<<c++ primer>>×÷×ÖµäºÍ¿ÎÍâ¶ÁÎÒòΪ̫ºñ²»¿ÉÄÜÒ»¿ÚÆø¿´Íê
level 2
È»ºó´Ó<<effective c++>>¿ªÊ¼×ªÖ°£¬ÕâÊÇÊ¥¾­£¬Çë×ñÊØ10½ë£¬Òª¾­³£¿´£¬Ã»Ê¾ÍÄÃÀ´·­·­ ......

ÎÒ×¼±¸×ö¸öJavaѧϰÊÔÑé(2010 01 23)

½ñÌìÊÇ2010Äê1ÔÂ23ºÅÁ賿£¬ÎÒºöÈ»×öÁ˸ö¾ö¶¨£¬Ï£Íû²»»áÁ÷²ú¡£ËäÈ»×î½üÒªºÃºÃѧϰӢÓ»¹ÒªÓÃC#Ϊһ¸öŮʿ×öÒ»¸öÔ±¹¤¹ÜÀíϵͳ¡£µ«ÊÇÎÒ¾ö¶¨Ã¿Ìì³é³öÖÁÉÙ3СʱºÃºÃѧϰjava¿´Á½ÖÜÄÜѧµ½Ê²Ã´¶«Î÷¡£
       ÏÖÔÚ½ö½ö»á°²×°ÅäÖÃjdk£¬ÓøöecpliseºÍJcreator±àдµã¼òµ¥³ÌÐò¡£Á¬jdk
api¶¼²»È ......

Java´úÂë¼ì²â¹¤¾ßPMD¹æÔò¼¯·­Òë


<!--
/* Font Definitions */
@font-face
{font-family:ËÎÌå;
panose-1:2 1 6 0 3 1 1 1 1 1;
mso-font-alt:SimSun;
mso-font-charset:134;
mso-generic-font-family:auto;
mso-font-pitch:variable;
mso-font-signature:3 135135232 16 0 262145 0;}
@font-face
{font-family:Verdana;
panose ......

ʵսÌå»áJava¶àÏ̱߳à³Ì¾«Òª

     ÔÚ Java ³ÌÐòÖÐʹÓöàÏß³ÌÒª±ÈÔÚ C »ò C++ ÖÐÈÝÒ׵ö࣬ÕâÊÇÒòΪ Java ±à³ÌÓïÑÔÌṩÁËÓïÑÔ¼¶µÄÖ§³Ö¡£±¾ÎÄͨ¹ý¼òµ¥µÄ±à³ÌʾÀýÀ´ËµÃ÷ Java ³ÌÐòÖеĶàÏß³ÌÊǶàôֱ¹Û¡£¶ÁÍê±¾ÎÄÒÔºó£¬Óû§Ó¦¸ÃÄܹ»±àд¼òµ¥µÄ¶àÏ̳߳ÌÐò¡£
 
¡¡   Ϊʲô»áÅŶӵȴý?
¡¡¡¡ÏÂÃæµÄÕâ¸ö¼òµ¥µÄ Java ³ÌÐ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ