Connection Test Tcp Socket Communication in C#

      Connection Test Tcp Socket Communication in C#

      Hello coders

      This is a small basic example how to make a simple TCP asynchronous Communication in C# under VS2008. I use Windows CE 5.0 and CF3.5 here.

      The example let´s the client send a Telegramm and the server responds to that with a answer telegram including just a incremented counter value send back to the client. The Client was waiting to that and if received he starts next telegram and so on. So it is like a loop running forever.
      To get it running you need start SmartDeviceServConnTest.exe and then the SmartDeviceClientConnectionTest.exe and then input the Server IP and press Begin Button.
      The samples run on desktop and CE device(I have tested it with Netdcu8´s here). You see the number of send and received TCP Telegrams per second on both the Client and the server panel.
      The example does not include thread safety ot any other error handling just to let it be as simple as it can be.

      My question is to the people who have knowdledge and experience in socket communication like with this example. When I do this test between 2 Desktop PC´s I see about 2100 Telgrams per second. When I do the same between 2 NETDCU8´s I see only poor 100 Telegrams per second :(.
      Is this usual or did I make some basic error n my code? The CPU usage is never above 60% so there seems to be some reserve in the NETDCU regarding the CPU.

      I am about new to this issues so please help if you see any chance to improve performance becuase I wonder why there is factor 100 between desktop an NetDcu8 (about factor 10 I would have expected).
      But may be it is like it is.

      thanks a lot in advance
      Andy
      Files

      Re: Connection Test Tcp Socket Communication in C#

      "andyinfsnet" wrote:

      When I do this test between 2 Desktop PC´s I see about 2100 Telgrams per second. When I do the same between 2 NETDCU8´s I see only poor 100 Telegrams per second :(.

      But it's not as simple as 1 GBit-LAN between the PCs and only 100 MBit-LAN between the two NetDCU8?

      Regards,

      H. Keller
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.

      Re: Connection Test Tcp Socket Communication in C#

      A ten times faster LAN is a ten times faster LAN. It's not the amount of data alone, it's also the response time (turnaround time). I don't know exactly, but probably when sending one data packet, there may go several additional protocol packets back and forth between the two endpoints. To compare the transfer times, you need to have the same environment, i.e. the same type of network. For example try to put a 100 MBit switch between the PCs and try again.

      Regards,

      H. Keller
      F&S Elektronik Systeme GmbH
      As this is an international forum, please try to post in English.
      Da dies ein internationales Forum ist, bitten wir darum, Beiträge möglichst in Englisch zu verfassen.