ÀûÓÃSocketʵÏÖC++ÓëFlexͨÐÅ(ת)
Ò»¡¢C++·þÎñÆ÷¶Ë
£¨ÓõÄÊÇVisual Studio 2008£¨05£¬03µÄÓ¦¸ÃÒ²¿ÉÒÔ£¬VC++µÄ¿ÉÄÜÐèÒªÉÔ΢¸Ä¶¯£©£©
´úÂëÈçÏ£º
#include <winsock2.h>
#include <stdio.h>
#include <windows.h>
#include <iostream>
using namespace std;
#pragma comment(lib,"ws2_32.lib")
void main(){
WORD wVersionRequested;
WSADATA wsaData;
int err;
short port=1300;//¶Ë¿ÚºÅ
wVersionRequested = MAKEWORD( 1, 1 );
err = WSAStartup( wVersionRequested, &wsaData );//³õʼ»¯Ì×½Ó×Ö
if ( err != 0 )
{
return;
}
if ( LOBYTE( wsaData.wVersion ) != 1 || HIBYTE( wsaData.wVersion ) != 1 )
{
WSACleanup( );
return;
}
SOCKET sockSrv=socket(AF_INET,SOCK_STREAM,0);//´´½¨Ì×½Ó×Ö
SOCKET sockConn;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×Ö
SOCKADDR_IN addrSrv;//ÓÃÀ´ºÍ¿Í»§¶ËͨÐŵÄÌ×½Ó×ÖµØÖ·
addrSrv.sin_addr.S_un.S_addr=htonl(INADDR_ANY);
addrSrv.sin_family=AF_INET;
addrSrv.sin_port=htons(port);
bind(sockSrv,(SOCKADDR*)&addrSrv,sizeof(SOCKADDR));//°ó¶¨¶Ë¿Ú
listen(sockSrv,5);//ÕìÌý
printf("Server %d is listening......\n",port);
SOCKADDR_IN addrClient;
int len=sizeof(SOCKADDR);
char buf[4096];//½ÓÊÕµÄÊý¾Ý
char rbuf[100]="³É¹¦";//·µ»ØµÄÊý¾Ý
while(1)
{
//½ÓÊÜÁ¬½Ó
sockConn=accept(sockSrv,(SOCKADDR*)&addrClient,&len);
printf("Accept connection from %s\n",inet_ntoa(addrClient.sin_addr));
//½ÓÊÕÊý¾Ý
int bytes;
if((bytes=recv(sockConn,buf,sizeof(buf),0))==SOCKET_ERROR){
&n
Ïà¹ØÎĵµ£º
ͨ¹ýÇ°ÃæÁ½Æª£¬ÏàÐÅ´ó¼ÒÒѾ»ù±¾Á˽âÁËÎÒÃǵÄÑо¿Ë¼Â·¡£¼ÈÈ»ÊÇÑо¿£¬ÄÇô±ØÐëµÄÑо¿¹¤¾ß¾ÍµÃÊìÁ·ÕÆÎÕÁË¡£ÕâÀïÎÒËùÖ¸µÄÑо¿¹¤¾ß¾ÍÊÇVC£¬ÎÒËùʹÓõÄVC°æ±¾ÊÇ2005¡£±¾ÎÄÒ²½«¸ù¾ÝVC2005½øÐÐ̽ÌÖ¡£¿ÉÄܺܶàÅóÓÑ»òÕß³õѧÕß»¹ÊÇʹÓõÄVC6.0¡£ÔÚÕâÀï±¾È˲»ÍƼöʹÓÃVC6.0¡£ÔÒòºÜ¼òµ¥£¬VC6.0ÒѾ¹ýʱÁË£¬ºóÃæµÄ°æ±¾±ÈVC6.0¸üÇ¿´ó·½±ã ......
MyEclipse
FlexµÄÅäÖÃÖ®³õÎÒÃÇ¿´¿´ÔµÓÉ£ºÒ»¿ªÊ¼Ñ§Ï°Ê¹ÓÃFlexµÄʱºò,ÎÒÊÇÓõĵ¥¶ÀµÄFlexBuilder3,×öЩ´¿FlexµÄÓ¦ÓóÌÐò»¹¿ÉÒÔ.µ«ÊÇÈç¹ûÒª
ºÍJava½áºÏÔÚÒ»ÆðʹÓÃ,¼´ÀûÓÃFLEX³äµ±Ò»¸öÍêÕûµÄJ2EEϵͳµÄWEB²ãµÄ»°,ÄÇôµ¥¶ÀʹÓÃFlexBuilder3ºÍMYECLIPSEÊǺܲ»
·½±ãµÄ,´ó´óÓ°ÏìÁË¿ª·¢Ð§ÂÊ,Òò´Ë×öÁËÏÂMyEclipse+FlexµÄÅäÖÃ,´ïµ½Ö ......
¿ªÊ¼ÈÕÆÚ Óë ½áÊøÈÕÆÚµÄ·¶Î§Ñ¡Ôñ
Á½Õß¶¼²»ÄÜ´óÓÚ½ñÌ죬¿ªÊ¼ÈÕÆÚ²»ÄÜ´óÓÚ½áÊøÈÕÆÚ
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" backgroundGradientColors="[#ffffff, #ffffff]">
<mx:Script>
......
1¡¢classµÄ¶¨ÒåÒ»¶¨ÒªÔÚºóÃæ¼Ó“£»”
2¡¢ÓÃcoutʱҪÔÚmainº¯Êýǰ¼Ó using namespace std;
3¡¢³öÏÖ undefined reference to `std::ios_base::Init::Init() ÌáʾµÄ»°£¬ÎÊÌâÊÇgcc±àÒëÆ÷³öÏֵ쬽â¾öµÄ°ì·¨ÊÇ£ºÔÚlinuxϱàÒëc++ ³ÌÐòҪʹÓÃg++ ±àÒëÆ÷,Èç¹ûÄãÒªÊÇʹÓÃgcc±àÒëÆ÷¾Í»áÓÐÉÏÃæµÄ±¨´íÐÅÏ¢,Ö»ÒªÔÚÔÚgccºó¼Ó ......
Flex±àÒë²ÎÊý
accessible=true|false ÊÇ·ñ¾ßÓпÉÀí½âÐÔ£¨ÈçΪ²Ð¼²ÈËÌṩ·½±ãµÄÐÔÄÜ£©
actionscript-file-encoding | ÉèÖÃÎļþ±àÂ룬ÈçShitf_JIS
advanced | mxmlc -help advanced£¬ÈçÕâÑùµÄ¸ß¼¶²ÎÊý
allow-source-path-overlap=true|false | ÑéÖ¤source-pathÖж¨ÒåµÄ·¾¶ÊÇ·ñ³öÏÖÖØµþ£¬³öÏÖ»¥Ïà°üº¬µÄÏÖÏó
as3=true|fa ......