Home Forums Support TCPConnection.GetConnection

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
  • #3255

    I’m attempting to create multiple clients within the same process. Each client will try to connect to the same server on the same IP address and port.

    When i use TCPConnection.GetConnection i keep on getting the same local endpoint, in fact this appears to be the same connection retrieved each time.

    This appears to be entirely consistent with the documentation so no issues there really.
    I assume if i were connecting to different remote endpoints, that i would get different connections each time, but i haven’t tested this.

    I want to set up a test system mainly for profiling, so having 100 separate client programs isn’t really what I’m after.

    Is it possible to establish, say, 100 connections to the same IP and port from within the same process?


    Heya David,

    Many thanks for your post and thank-you for your support of our network library.

    You are correct that NetworkComms.Net will always use an existing connection to the same remote endpoint if one exists. This is to ensure the overhead due to connection establishment is minimised. Unless you modify the source it is not possible to prevent this behaviour.

    What you can do however is create N listeners, all on a different ports (but the same IP), and then connect to each port independently. If you purchased either the Indie or Enterprise packages there is an included sample that does the above, in the DebugTest project, NumConnectionsLoadTest.cs.

    Hope that’s helpful,
    Kind regards,


    Thanks for the prompt reply MarcF,

    I’ll give the N listener approach a try.


Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.