Tech Off Thread

11 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

Socket Connections

Back to Forum: Tech Off
  • User profile image
    ubercoder

    Hi,

    I'm building a client\server app to allow users to connect to a server using a socket connection.

    This connection will stay open for a long time, exchanging small text messages back and forth.

    I want to get an idea on how many open concurrent connection a well equipped server (dual xeons, 4 GB RAM, etc) can handle with a decent performance.

    Which tools are you suggesting?

    System.Net.Sockets
    IPworks
    Other?

    Thanks.

  • User profile image
    pathfinder

    System.Net.Sockets would be my first choice.  Both the 1.1 and the 2.0 framework have solid support.  The 2.0 framework has more configurable options, such as timeout on blocking connectsion.

    I wrote a high performance app a few weeks ago that reads rows from a database and sends them over a tcp connection.  .NET had no problem keeping over several hundred connections open simultaneously and sending several thousand messages per connection.  In fact it transmitted over 50,000 200 byte messages in about four minutes. 

    If you are using an xp box, one thing to be aware of is that Windows XP only allows just under 4000 sockets open at any time:
    http://blogs.msdn.com/dgorti/archive/2005/09/18/470766.aspx

  • User profile image
    ubercoder

    Pathfinder,

    Thanks for your reply.

    I have to use .Net 1.1 but these numbers look very good to me.
    50,000 messages in 4 minutes is more that I need.

    I'll use a Windows 2003 loaded box for the socket server.
    I think the limit is 16,000 sockets.

    Can you send me that code, please??? Smiley

    Ubercoder.

  • User profile image
    pathfinder

    ubercoder wrote:
    Pathfinder,

    Can you send me that code, please??? Smiley



    Sorry I can't send you the exact code because of trade secrets.  It was written to test payment transaction data.

    Anyways, I put together a quick example and posted it to the sandbox

    http://channel9.msdn.com/ShowPost.aspx?PostID=224635

  • User profile image
    ubercoder

    Thanks for the code, it's a good start.

    I also weight the option to use nSoftware IPWorks so I don't have to invest time on creating a high performance server.

  • User profile image
    PerfectPhase

    IPWorks IPDeamon component is ideal for what you want, though it does isolate you from being able to accept connections by IP address etc.

  • User profile image
    ubercoder

    PerfectPhase wrote:
    IPWorks IPDeamon component is ideal for what you want, though it does isolate you from being able to accept connections by IP address etc.


    Can you please be more specific???

    What do you mean by "isolate you from being able to accept connections by IP address"???

    I'm thinking of using the tool for a high demand app.

    Did you ever use it???

  • User profile image
    ScanIAm

    I'm working on a project that uses it, and to be honest, it's no better than System.Net.sockets.  It does have the added disadvantage of being a pain to get compiled correctly.  It forces you to link in some license information, and it doesn't do a very good job of explaining how to do it, so apps that work perfectly on your machine pop up an annoying 'please register' dialog on another machine.

    You have to pay extra for phone support.

    I'd personally never use it ever again.

  • User profile image
    ubercoder

    The reason I want to use an existing component and not System.Net.Sockets directly is because I haven't done any socket programming before.

    I've looked for some code for a server and a client but I couldn't find any good set of source code that assembles a real world application; only some basic examples, never a full solution.

    The app I'm building is very high profile and sockets is a small part of its functionality but very crucial.

    I don't have time to invest on learning sockets.

    Except the licensing issues, how IPWorks performs as a component?
    I like that they have a lot if events to handle most of the tasks???
    Did you use it with IPPort??

  • User profile image
    PerfectPhase

    Forget the comment about the IP address, I have spent to long doing other things (sockets in a different OS) and got the two confussed Smiley

    Anyway, yes I had a client app that used IPPort and the test server was writen with IPDeamon, the real server was writen in delphi, so I never really stress tested it passed about 10 connections, but I never had any problems with it.

  • User profile image
    ubercoder

    Does anyone can point me to a free/open source socket server/client piece of code using System.Net.Sockets ???

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.