connection oriented or message oriented pipe server?

This is a discussion on connection oriented or message oriented pipe server? within the C++ Programming forums, part of the General Programming Boards category; hello, I am currently working on a windows service which is talking to multiple instances of another program. The number ...

  1. #1
    Registered User
    Join Date
    Apr 2011
    Location
    europe
    Posts
    3

    Question connection oriented or message oriented pipe server?

    hello,

    I am currently working on a windows service which is talking to multiple instances of another program. The number of client instances is not fixed and changing dynamically. However the maximum number is relatively low, below 20, and the service can handle the load easily.
    The programs are sending messages about every five seconds. These messages are nothing more than simple structs containing two DWORDs, so:

    Code:
    struct msg{
    DWORD dwThreadId;
    DWORD dwEventId;
    }
    Since every instance is alive over a longer period of time and will send hundreds of messages I wonder if it is better to keep this message oriented approach or switch to a connection oriented approach. I could imagine assigning one instance of the named pipe to one client. So the pipe instance would determine the client's thread id, while the client will not send msg structs, but only the event ids.

    In this scenario it will probably have no major impact, but if we assume the clients would send multiple messages per second, I believe a connection oriented approach would be more efficient. The overhead to create a pipe instance is reduced to one time as well as the message traffic is reduced by 50% since only one DWORD needs to be sent.
    Both approaches can easily be multithreaded since either a thread is spawned for processing every message, or one thread is spawned for processing and managing one single pipe. If an client is terminated, the piple will be closed.

    I wonder if named pipes on Windows are suited for this sort of communication? It appears to me the connection oriented approach is the cleaner, overall more efficient one...

    greetings,
    curiosity
    Last edited by curiosity; 06-28-2011 at 03:02 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Object Oriented C
    By CSaw in forum C Programming
    Replies: 6
    Last Post: 07-06-2011, 06:06 AM
  2. Object oriented SDL
    By jamort in forum Game Programming
    Replies: 3
    Last Post: 01-31-2011, 09:07 AM
  3. new to object oriented!!!!
    By salmanriaz in forum C++ Programming
    Replies: 2
    Last Post: 03-12-2009, 08:43 AM
  4. object oriented C
    By FlatLost in forum C Programming
    Replies: 4
    Last Post: 11-08-2005, 06:22 AM
  5. Replies: 1
    Last Post: 01-07-2002, 12:17 PM

Tags for this Thread


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21