kyuseo의 게임 프로그래밍

인터넷 TCP/IP소켓 (Internet TCP/IP Socket)을 5000개 이상 다수 오픈 방법 본문

C++ 개발

인터넷 TCP/IP소켓 (Internet TCP/IP Socket)을 5000개 이상 다수 오픈 방법

kyuseo 2008. 3. 11. 18:27

개요..

 

Window(윈도우) 2000 / XP / Server 기본 설정으로는 인터넷 TCP/IP소켓 (Internet TCP/IP Socket)을 5000개 이상 열 수 없습니다.

 

TCP/IP 소켓을 5000개 이상 다수 오픈하여 여는 방법을 알려드립니다.

 

 

방법

 

출처 : MS 사이트

 

 


The information in this article applies to:

 

  • Microsoft Windows NT Server versions 3.51, 4.0
  • Microsoft Windows NT Server, Enterprise Edition version 4.0
  • Microsoft Windows NT Workstation versions 3.51, 4.0

     


    IMPORTANT: This article contains information about editing the
    registry. Before you edit the registry, make sure you understand how
    to restore it if a problem occurs. For information about how to do
    this, view the "Restoring the Registry" Help topic in Regedit.exe or
    the "Restoring a Registry Key" Help topic in Regedt32.exe.

    SYMPTOMS

     

    When you attempt to set up TCP connections from ports above 5000,
    the local computer responds with a WSAENOBUFS (10055) error, which
    means:

     

    An operation on a socket could not be
    performed because the system lacked sufficient buffer space or
    because a queue was full.

     

     

    RESOLUTION

     

    The default maximum number of ephemeral TCP ports for Microsoft
    Windows NT is 5000. A new parameter has been added to Windows NT
    3.51 Service Pack 5 and to Windows NT 4.0. To increase the maximum
    number of ephemeral ports you must set the following registry
    parameter:

    IMPORTANT: This article contains information
    about editing the registry. Before you edit the registry, make sure
    you understand how to restore it if a problem occurs. For
    information about how to do this, view the "Restoring the Registry"
    Help topic in Regedit.exe or the "Restoring a Registry Key" Help
    topic in Regedt32.exe.

    WARNING: Using Registry Editor
    incorrectly can cause serious problems that may require you to
    reinstall your operating system. Microsoft cannot guarantee that
    problems resulting from the incorrect use of Registry Editor can be
    solved. Use Registry Editor at your own risk.

    For
    information about how to edit the registry, view the "Changing Keys
    And Values" Help topic in Registry Editor (Regedit.exe) or the "Add
    and Delete Information in the Registry" and "Edit Registry Data"
    Help topics in Regedt32.exe. Note that you should back up the
    registry before you edit it. If you are running Windows NT, you
    should also update your Emergency Repair Disk (ERD).

     

  1. Start Registry Editor (Regedt32.exe).
  2. Locate the following key in the registry:


    class=FIXEDTEXT>HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters

  3. On the Edit menu, click Add Value, and then add the following
    registry value:

    Value Name:
    MaxUserPort Data Type: REG_DWORD Value: 65534 <for example>


    Valid Range: 5000-65534 (decimal) Default: 0x1388
    (5000 decimal)

    Description: This parameter controls the
    maximum port number used when an application requests any
    available user port from the system. Normally, ephemeral (that is,
    short-lived) ports are allocated between the values of 1024 and
    5000 inclusive.
  4. Quit Registry Editor.

NOTE: An additional
registry parameter TCPTimedWaitDelay will determine how long a
closed port will wait until being reused. For additional
information, please see the following article in the Microsoft
Knowledge Base:


href="http://support.microsoft.com/support/kb/articles/Q149/5/32.ASP">Q149532
Windows NT Clients Run Out of Ports

 

 

MORE INFORMATION

 

For additional information, please see the following white paper
available on the Microsoft anonymous ftp server:

File Name: TCPIPIMP2.doc
Location :
href="ftp://ftp.microsoft.com/bussys/winnt/winnt-docs/papers/TCPIPIMP2.doc"
target=_top>ftp://ftp.microsoft.com/bussys/winnt/winnt-docs/papers/TCPIPIMP2.doc
Title
: "Microsoft Windows NT 3.5/3.51/4.0: TCP/IP Implementation
Details"

 

 

Keywords : kbnetwork
Issue type : kbprb
Technology :