©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.(2002)02-0042-02Socket1,2(11,122000;21,122000):Socket,Socket,.:Socket;;TCPPIP:TP314:A1Socket,UNIXTCPPIP,TCPPIPUNIX,TCPPIP(API),APISocket.,SocketTCPPIPAPI,InternetAPI.Socket,Socket.Socket,,Socket,Socket.2SocketSocket,Socket,Socket,SocketSocket,Socket:Socket-handle=Socket(protocol-family,socket-type,protocol),protocol-family(),Socket-type(),protocol().Socket,Socket,SocketSock2et,Socket,Socket,Socket.3SocketSocket,Socket,Socket:20011020:(19722),,,,.©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.=Connect(Socket-handle,remote-Socket-address,address-length)Socket-handle(Socket),SocketSocket.remote-Socket-address(Socket),Socket,Socket,connect,Socket.address-length(),Socket.412connect,Socket,bind,bindSocket,Socket.result=bind(Socket-handle,local-Socket-address,address-length)5SocketSocket,,.511SocketWriteWritevSocket,.result=write(Socket-handle,message-buffer,buffer-length),message-buffer,buffer-length.result=writev(socket-handle,to-vector,vector-length),to-vector,writev,.vector-length.result=send(Socket-handle,message-buffer,buffer-length,special-flags)sendWrite,,,.512SocketSocket,Sendtosendmsg.result=sendto(Socket-handle,message-buffer,buffer-length,special-flags,socket-ad2dress-structure,address-structure-length)(74)©1994-2010ChinaAcademicJournalElectronicPublishingHouse.Allrightsreserved.()(43)send,,.sendmsg.result=sendmsg(socket-handle,message-structure,special-flags),sendmsgwritev:.6SocketSocket:readreadevrecvrecvfromrecvmsg,Socket,.Socket,.,recvreadreadev.7WindowsSocketSocketBerkeleySocket,SocketBerkeleySocket.,Microsoftwin2dows,windowsSocket,BerkeleySockets,,windows.win2dowsSocketwindows.,windowsInternetWinsock.:[1]DouglasE1Comer.TCPPIPM.:.()