ÄãºÃ£¬»¶Ó­À´µ½¾­¹ÜÖ®¼Ò [µÇ¼] [×¢²á]

ÉèΪÊ×Ò³ | ¾­¹ÜÖ®¼ÒÊ×Ò³ | Êղر¾Õ¾

ÍøÂ缴ʱͨѶϵͳµÄ½çÃæÉè¼Æ_×Ô¶¯»¯×¨ÒµÂÛÎÄ·¶ÎÄ

·¢²¼Ê±¼ä£º2015-01-18 À´Ô´£ºÈË´ó¾­¼ÃÂÛ̳
×Ô¶¯»¯×¨ÒµÂÛÎÄ·¶ÎÄ Ä¿ ¼ ÕªÒª¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­II 1 Ð÷ÂÛ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­1 1.1¿ÎÌâµÄ±³¾°¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­1 1.2¼´Ê±Í¨Ñ¶ÏµÍ³Ñо¿ºÍÓ¦ÓÃÏÖ×´¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­1 1.3¼´Ê±Í¨ÐÅÊг¡µÄ·¢Õ¹Ç÷ÊÆ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­3 1.4Ñо¿µÄ»ù±¾ÄÚÈÝÓëÄâ½â¾öµÄÖ÷ÒªÎÊÌ⣺¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­4 1.5Ñо¿µÄ·½·¨Óë¼¼Êõ·Ïߣº¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ .4 2 ¼´Ê±Í¨ÐÅϵͳµÄ¼¼Êõ±³¾°¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­ . .6 2.1 ¼´Ê±Í¨ÐÅϵͳ½á¹¹Ä£ÐÍ¡ª¡ªP2PÄ£ÐÍ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­6 2.1.1 P2PµÄ¸ÅÄî¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­6 2.1.2 P2P¼¼ÊõµÄÌص㡭¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­6 2.1.3 P2PÄ£ÐÍ·ÖÀà¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­7 2.2´«ÊäЭÒé¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­9 2.2.1 TCP/IPЭÒéµÄ²úÉúºÍ·¢Õ¹¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­10 2.2.2 TCP/IPµÄÓŵ㡭¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­10 2.2.3 TCP/IPµÄ²Î¿¼Ä£ÐÍ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­11 2.3 Ì×½Ó×Ö¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­13 3 Visual C++µÄÍøÂç±à³Ì¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­15 3.1 Socket¸ÅÊö¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­15 3.1.1 Socket¼ò½é¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­15 3.1.2 Socket±à³Ì¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­15 3.1.3 Windows Socket·¢Õ¹¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­15 3.1.4 Windows Socket·ÖÀà¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­17 3.1.5 Windows Socket API¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­17 3.2 Windows SocketsµÄ±à³ÌÔ­Àí¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­19 3.2.1 Ì×½Ó×ÖµÄÀàÐÍ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­19 3.2.2 »ùÓÚTCPµÄSocket±à³Ì¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­20 3.2.3 »ùÓÚUDPµÄSocket±à³Ì¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­21 3.2.4 WinsockµÄÆô¶¯ºÍÖÕÖ¹¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­21 3.2.5 ´íÎó¼ì²éºÍ¿ØÖÆ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­22 3.2.6 Á÷Ì×½Ó×Ö±à³ÌÄ£ÐÍ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­23 3.2.7 Êý¾Ý±¨Ì×½Ó×Ö±à³ÌÄ£ÐÍ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­25 4 ¼´Ê±Í¨Ñ¶ÏµÍ³µÄ½çÃæÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­.26 4.1 ¶Ô»°¿òÓ¦ÓóÌÐòÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­26 4.1.1»ù±¾¶Ô»°¿ò´´½¨¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­.26 4.1.2ÉèÖöԻ°¿òÊôÐÔ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­28 4.1.3±ê×¼¿Ø¼þµÄÓ¦Óá­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­28 4.2 Ö÷½çÃæÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­.30 4.3 Ìí¼ÓºÃÓѽçÃæÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­34 4.4 ÁÄÌì½çÃæÉè¼Æ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­35 4.5 ÌØЧ¹¦ÄÜ ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­38 4.6ϵͳµÄ±àÒë ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­.43 5 ×ܽᡭ¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­.44 Ö л¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­.45 ²Î¿¼ÎÄÏס­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­¡­46 Õª Òª ¼´Ê±Í¨Ñ¶ÏµÍ³ÊÇÄ¿Ç°InternetÉÏ×îΪÁ÷ÐеÄͨѶ·½Ê½£¬Ëü×î»ù±¾µÄ¹¦ÄܾÍÊÇͨ¹ý¼ÆËã»úÖ®¼äµÄÎı¾Êý¾ÝµÄ»¥»»ÐÎʽ£¬ÊµÏÖ˼ÏëµÄ½»Á÷ºÍ¹µÍ¨£¬ËüµÄÓŵãÊÇ·½±ã¿ì½Ý£¬ÎªÈËÃǵŵͨ´´½¨ÁËÒ»ÖÖÐÂÐ͵ġ¢Á®¼ÛµÄ¡¢¿ìËٵġ¢¼ò±ãµÄ¹µÍ¨·½Ê½¡£ È»¶øÓÉÓÚÄ¿Ç°µÄÆóÒµ£¬ÓÈÆäÊÇ´óÐ͵ÄÆóÒµ£¬´ó¶¼ÓÐ×Ô¼ºµÄInternetÍøÂ磬Æä´ó¶àµÄ¹¤×÷Á÷»òÄÚ²¿½»Á÷¶¼¿ÉÒÔͨ¹ýÄÚ²¿µÄInternetÍê³É¡£Èç¹ûÆóÒµÖÐÔ±¹¤¶¼Ê¹ÓÃÄ¿Ç°Ãâ·ÑµÄ¼¸ÖÖ¼´Ê±Í¨Ñ¶Èí¼þ£¬Ôò±ØÐë¶ÔÕâЩʹÓýøÐÐÑϸñµÄÉó¼ÆºÍ¹ÜÀí£¬ÕâÎÞÒɸøIT²¿ÃŵŤ×÷´øÀ´ÁËÒ»¶¨µÄÂé·³¡£ ËùÒÔÎÒÈÏΪ£¬ÓбØÒªÒ²ÓпÉÄÜ¿ª·¢Ò»¿î¼´Ê±Í¨ÐÅÈí¼þ£¬Ê×ÏÈÃæÏòÆóÒµÄÚ²¿Ê¹Ó㬽ø¶ø·¢Õ¹µ½¹«ÍøÓ¦Óã¬ÒÔÆÚ³ÉΪһ¸öÆóÒµÄÚ²¿¡¢ÆóÒµÓëÆóÒµÖ®¼ä»¥ÏཻÁ÷µÄƽ̨¡£Ê×ÏÈÔÚ¼´Ê±Í¨Ñ¶ÏµÍ³·þÎñµÄÄÚ²¿ÍØÆËÖÐÎÒ²ÉÓÿͻ§/¿Í»§Ä£ÐÍ£¨P2P£©¡£ÕâÖÖÄ£ÐÍÖ÷ÒªÓÃÓÚСÐ;ÖÓòÍøÄÚ¿Í»§¼äµÄ»¥ÏàͨѶ.ËüµÄÌصãÊÇ:ʹÓÃÈÝÒ×,¸÷¿Í»§ÉϵÄ×ÊÔ´¿ÉÖ±½Ó¹²Ïí,²¢ÇÒÈÝÒ×°²×°ºÍά»¤,²»ÐèҪרÓõķþÎñÆ÷¡£È»ºóÎÒÑ¡ÔñVisual C++½øÐгÌÐò±à³Ì£¬ÒòΪVisual C++±à³ÌÓïÑÔÊÇÒ»ÖÖ¿ÉÊÓ»¯¿ª·¢¹¤¾ß£¬¿ÉÓÃÓÚ¿ª·¢»ùÓÚWondows²Ù×÷ϵͳµÄ32λӦÓóÌÐò¡£ ×îºó£¬Í¨¹ý¶Ô¼´Ê±Í¨Ñ¶ÏµÍ³µÄÑо¿£¬Á˽âÁËÏÖ½ñ¼´Ê±Í¨ÐÅϵͳµÄ·¢Õ¹ÂöÂ磬ͬʱҲָ³öÁ˼´Ê±Í¨Ñ¶Ñо¿Öеȴý½â¾öµÄÎÊÌâ¡£ ¹Ø¼ü´Ê£º¼´Ê±Í¨Ñ¶¡¢P2P¡¢Visual C++ Abstract Instant messaging systems is the most popular means of communication, it is the most basic functions of text data between computers through the exchange of forms, to achieve the exchange of ideas and communication, it has the advantage of convenience for communication between people to create a new, cheap, fast, easy means of communication. However, due to the existing enterprises, especially large enterprises and large have their own Internet networks, the majority of the workflow or internal communication within the Internet can be completed by. If the enterprise employees are now free to use several instant messaging software, you must use strictly to these audits and management, which will undoubtedly bring to the IT departments some trouble. So I think there is a need also possible to develop a real-time communication software, the first for internal use, then to the public network applications, in order to become an enterprise, business to business exchange platform. First of all, instant messaging services in the internal topology I used the client / customer model (P2P). This model is mainly used for small-scale local area network communicate with each other among customers. Its features are: ease of use, customers can directly share the resources, and easy to install and maintain, does not require a dedicated server. Then I select the Visual C + + for programming, because the Visual C + + programming language is a visual development tool, can be used to develop 32-bit operating system based on Wondows applications. Finally, research on instant messaging, instant messaging systems to understand the current context of development, but also pointed out the study to wait for instant messaging solution. Keywords£ºInstant messaging¡¢P2P¡¢Visual C++
¾­¹ÜÖ®¼Ò¡°Ñ§µÀ»á¡±Ð¡³ÌÐò
  • ɨÂë¼ÓÈë¡°¿¼ÑÐѧϰ±Ê¼ÇȺ¡±
ÍƼöÔĶÁ
¾­¼ÃѧÏà¹ØÎÄÕÂ
±êÇ©ÔÆ
¾­¹ÜÖ®¼Ò¾«²ÊÎÄÕÂÍƼö