Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8868655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T17:19:12+00:00 2026-06-14T17:19:12+00:00

I need to create a client that connects to a medical machine over tcpip.

  • 0

I need to create a client that connects to a medical machine over tcpip. This machine, upon internal event, send me one or more XML file with the data I need to process. As these events are not pretictable, I thought about asynchronous connection which get the data and save it on filesystem. Basically for each XML send by that machine I have to save it onto disk.

I googled a bit as I have not much experience in tcp/ip programming and I found on MSDN an example of asynchronous client (Client Example)

First of all, doesn’t work property as Console.WriteLine("Response received : {0}", response); is never hit. Then when that machine send me just one file, on the buffer I have same data twice. And also I’m guessing how to detect EOF among xml files sent.

I also thought about polling but seems to be uncorrect as solution.
Any hints?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T17:19:13+00:00Added an answer on June 14, 2026 at 5:19 pm

    I pretty sure polling will not help in this case.

    Few things that can show you some good pointers to start with:

    1). Socket gives you the received data in some pre-defined provided byte array of the size you decide so decide the size well.
    Eg:

    public const int BufferSize = 256;
    

    for the example at MSDN, is 256, now if your data is of 260 bytes in size it will first send you the 256 bytes and then on the next receive it will send you the rest 4 bytes. This can be the one reason you need to find a way to pile up all this data received and then each time check for an start identifier and end identifier to extract the data that you need. From another view if you define a bigger byte buffer size considering the average size of your data. In most of the case you will receive the entire message in one go. But still you cannot achieve it 100% and that is the way socket works.

    2). You might have received the data twice or some kind of broken data because the buffer byte array is not cleared at the proper time or is not flushed before next use.

    3). EOF or EOT can be decided in may ways, if you have control on the medical machine you can insert an identifier at the end before it sends the data and use the same to differentiate the messages sent. If you dont have programmatic control on the sender and you are sure of XML format to be received you can always try to find the “<xml>” “</xml>” text in the data received and differentiate on that basis.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My target: Create node.js server and client applications that will send antyhing (event, string,
I need to create a web app for a client, and one of the
I need to create/update/remove cookie for FireFox browser. This cookie is a client cookie,
I need to create Client/Server application to send files from clients to Server. I
I need to build a client application that connects to the team foundation server
I need to create a service that will send forex prices to thousands of
We need to create a file management interface that integrates with the clients current
I need to create a server which creates a new thread for each client
I have a need to create a HttpSession (via cookie) whenever a client invokes
I want to run my client program 25,000 times. I need to create a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.