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

  • Home
  • SEARCH
  • 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 9242335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:33:37+00:00 2026-06-18T08:33:37+00:00

I was wondering if someone would be able to help me with a small

  • 0

I was wondering if someone would be able to help me with a small problem I am having.

I will be receiving a xml file that is going to be sent through a tcp socket. I am trying to create a small application that can act as the server and send a xml file through a tcp socket. I can then start testing my initial application that will be receiving and processing this xml document.

I have tried Google and keep running into dead ends on this one.

  • 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-18T08:33:38+00:00Added an answer on June 18, 2026 at 8:33 am

    One possible solution is to load the xml either as a series of strings or as a byte array and send that. The byte array approach might be the most concise, using the network library networkcomms.net the application calling the sending would look something like this:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    using NetworkCommsDotNet;
    
    namespace Client
    {
        class Program
        {
            static void Main(string[] args)
            {
                byte[] bytesToSend = File.ReadAllBytes("filename.xml");
                TCPConnection.GetConnection(new ConnectionInfo("127.0.0.1", 10000)).SendObject("XMLData", bytesToSend);
    
                Console.WriteLine("Press any key to exit client.");
                Console.ReadKey(true);
                NetworkComms.Shutdown();
            }
        }
    }
    

    and the server:

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    using NetworkCommsDotNet;
    
    namespace Server
    {
        class Program
        {
            static void Main(string[] args)
            {
                NetworkComms.AppendGlobalIncomingPacketHandler<byte[]>("XMLData", (packetHeader, connection, incomingXMLData) => 
                {
                        Console.WriteLine("Received XMLData");
                        File.WriteAllBytes("filename.xml", incomingXMLData);
                });
    
                TCPConnection.StartListening(true);
    
                Console.WriteLine("Server ready. Press any key to shutdown server.");
                Console.ReadKey(true);
                NetworkComms.Shutdown();
            }
        }
    }
    

    You will obviously need to download the NetworkCommsDotNet DLL from the website so that you can add it in the ‘using NetworkCommsDotNet’ reference. Also see the server IP address in the client example is currently “127.0.0.1”, this should work if you run both the server and client on the same machine. For more information also checkout the getting started or how to create a client server application articles.

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

Sidebar

Related Questions

I was wondering if someone would be able to help me out with this
Im wondering if someone might be able to help me with something that i
I was wondering if someone would be able to help or point me in
I was wondering if someone would be able to help me write a CQL
I am wondering if someone might be able to help me solve a display
I was wondering if someone would be able to shed some light on how
I'm having trouble getting some data.... I was wondering if someone can help me,
I'm wondering if someone would help me troubleshoot my test for stream.publish. I thought
I was wondering if someone might be able to help me solve the Lotka-Volterra
Wondering if someone could help me. I have next to no knowledge with Ajax,

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.