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 7857459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T21:03:09+00:00 2026-06-02T21:03:09+00:00

i want to create some service that will run as simple process and will

  • 0

i want to create some service that will run as simple process and will give some other application the possibility to send him xml stream.

What i mean is to create simple process ( exe ) with Infinite loop – and any application will be able to send XML ( file / stream ) to this process => and this process will send the xml to some socket.

Is it possible to do it without pipe ?
I want to do something like COM – that can ‘catch’ instance of working process.

  • 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-02T21:03:10+00:00Added an answer on June 2, 2026 at 9:03 pm

    sure.

    you can use Named Pipe classes in c# :

    Server :

    using (var s = new NamedPipeServerStream ("myPipe"))
    {
     s.WaitForConnection();
     s.WriteByte (100);
     Console.WriteLine (s.ReadByte());
    }
    

    client code:

    using (var s = new NamedPipeClientStream ("myPipe"))
    {
     s.Connect();
     Console.WriteLine (s.ReadByte());
     s.WriteByte (200);  
    }
    

    edit

    you can do it by file. + systemfileWatcher Class

    put a file in a folder.

    the other process will audit this folder.

    and now you can transfer info.

    edit2

    you can use memoryMappedFile

    and open a view in each process to see the same mempry region – and transfer data.
    I think its the best.

    Process A :

     static void Main(string[] args)
            {
                using (MemoryMappedFile mmf = MemoryMappedFile.CreateNew("testmap", 4000))
                {
                    bool mutexCreated;
                    Mutex mutex = new Mutex(true, "testmapmutex", out mutexCreated);
                    using (MemoryMappedViewStream stream = mmf.CreateViewStream())
                    {
                        BinaryWriter writer = new BinaryWriter(stream);
                        string st = "Hellow";
                        int stringSize = Encoding.UTF8.GetByteCount(st); //6
                        writer.Write(st);
                        writer.Write(123); //6+4 bytes = 10 bytes
                    }
                    mutex.ReleaseMutex();
                    Console.WriteLine("Start Process B and press ENTER to continue.");
                    Console.ReadLine();
                    mutex.WaitOne();
                    using (MemoryMappedViewStream stream = mmf.CreateViewStream())
                    {
                        BinaryReader reader = new BinaryReader(stream);
                        Console.WriteLine("Process  A  says: {0}", reader.ReadString());
                        Console.WriteLine("Process  A says: {0}", reader.ReadInt32());
                        Console.WriteLine("Process  B says: {0}", reader.ReadInt32());
                    }
                    mutex.ReleaseMutex();
                }
            }
    

    Process B writes to its region

     static void Main(string[] args)
            {
                try
                {
                    using (MemoryMappedFile mmf = MemoryMappedFile.OpenExisting("testmap"))
                    {
                        Mutex mutex = Mutex.OpenExisting("testmapmutex");
                        mutex.WaitOne();
                        using (MemoryMappedViewStream stream = mmf.CreateViewStream(11, 0)) // From the 11 byte....
                        {
                            BinaryWriter writer = new BinaryWriter(stream, Encoding.UTF8);
                            writer.Write(2);
                        }
                        mutex.ReleaseMutex();
                    }
                }
                catch (FileNotFoundException)
                {
                    Console.WriteLine("Memory-mapped file does not exist. Run Process A first.");
                }
            }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create a DispatchMessageInspector for my WCF service that will run before
I want to create some kind of AJAX script or call that continuously will
I want to create some diagrams for some papers. Diagrams will contain some text,
I want to create some simple navigation in sencha touch 2. I have questions
We have some standalone devices that will send XML messages to arbitrary processing software
This may already exist I hope. I want to create a Windows service that
i want to create some command line utilities to manage many wordpress site, allowing
I want to create some text in a canvas: myText = self.canvas.create_text(5, 5, anchor=NW,
I want to create some up and down buttons using the standard button background
I want to create some table through PHP but it fails everytime, but the

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.