:2005-10:(1980),,,;(1963),,,,(,200072):TCP/IP,Windows:TCP/IP;Socket;/;;:TP393:B:1006-2394(2006)01-0050-02NetworkCommunicationProgramDesignBasedonTCP/IPandItsApplicationinGas2sensitivitySensorATSLIGuo,XUYong2jin,WANGZheng2hong(DepartmentofAutomation,ShanghaiUniversity,Shanghai200072,China)Abstract:SomeprimaryconceptonnetworkcommunicationprogramdesignbasedonTCP/IPwasintroduced.ThecommunicationprogramdesignbetweenmicroprocessorandcomputerbasedonWindowsoperatingsystemanditsapplicationingas2sensitivitysensorATSwereanalysed.Keywords:TCP/IP;Socket;client/servermodel;networkcommunication;ATS11.1TCP/IP,,(I/O),SocketSocket(API)SocketAPI,Socket111.2SocketWinsock(Socket),TCP/IP,,:(StreamSocket)(DatagramSocket),TCP,UDPWindows,SocketWinsockAPIWinsockAPI,Winsock[1]1.3/TCP/IP//,,,,[2]2,(),(),,,/,,,TCP0520061Windows,Rabbit3000,,TCP/IP,VC++6.0,CAsyncSocket;Socket,Rabbit3000:(1)tcpSocket;(2)sockinit(),;(3),tcplisten();(4)sockestablished();(5)sockread()sockwrite();(6)sockclose(),tcpSocket,,tcpSocket,tcptick(),10/s,:(a);(b)TCPsocket[3],()VC++6.0CAsyncSocketCreate()Connect()Send()Receive()Close()Rabbit3000,TCP,223():tcpSocketsock;//tcpSocket;intbytes1;//;intbytes2;//;charbuff1[800];//;charbuff2[800];//;sockinit();////voidestablishlink(void){if(!tcplisten(&sock,MYPORT,INCOMINGIP,INCOMINGPORT,NULL,0))printf(Failedtolisten\n);//tcplisten(),//Failedtolistenelsewhile(!sockestablished(&sock)){if(!tcptick(&sock)){printf(Failedtoestablish\n);break;}}//sockestablished(),}//Failedtoestablish//{tcptick(&sock)bytes1=sockfastread(&sock,buff1,BUFFSIZE);//;;}//{;bytes2=sockwrite(&sock,buff2,datalength);//;}():CXyjSocketCAsyncSocket,CXyjSockettcpsocket;//CXyjSocket;voidCMaincontrolerView::ConnectServer(){if(tcpsocket.Create(0,SOCKSTREAM,FDREAD|FDCONNECT|FDWRITE|FDCLOSE)==TRUE){intConnectOK=tcpsocket.Connect((SOCKADDR3)&mAddr,sizeof(mAddr));}//Create()Connect()}//,ConnectOK1,,:[1],,.VisualC++[M].:,2001.[2]W.RichardStevens,,,,.TCP/IP,:[M].:,2000.[3]RabbitSemiconductorCorporation.DynamicCTCP/IPUsersManual[Z].2002.()1520061