Find the answer to your Linux question:
Results 1 to 4 of 4
Hi, I am newbie and need to implement custom component on unix for unidirectional communications. Client applications all on local box, around 1000 of them, will send short (fixed size ...
  1. #1
    Just Joined!
    Join Date
    Jan 2008
    Posts
    2

    Question programming high load unidirectional application

    Hi, I am newbie and need to implement custom component on unix for unidirectional communications.
    Client applications all on local box, around 1000 of them, will send short (fixed size 8 bytes) data packets to the server.
    Send will happen pretty often, thousands per second. Clients are all local applications.
    Server component will store this data and process, at some point.

    The question is what is the most efficient way to implement such intercommunication,
    will unix named datagram socket do that job?
    How to ensure reliable data transfer assuming all clients are always connected and may send data?
    What mechanism to use for client multiplexing, can fork() be avoided?

    Thanks,
    Conrad

  2. #2
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    Is the server also on the same local box?
    --
    Bill

    Old age and treachery will overcome youth and skill.

  3. #3
    Just Joined!
    Join Date
    Jan 2008
    Posts
    2

    yes server is local too

    yes server is local too, all clients and server are on the same box.
    Please advice.

  4. #4
    Linux Engineer wje_lf's Avatar
    Join Date
    Sep 2007
    Location
    Mariposa
    Posts
    1,192
    You'd have to try several communications approaches to see which one was the highest performance for you, but since everything is on the same box, I'd try a fifo (named pipe) first.

    You make it with the mkfifo command. You open it on the server side read only. You open it in each client write only.

    The simplest situation is when the server reads eight bytes, processes them, and then goes back to the beginning of the loop to read another eight bytes. Things can get a bit more complicated, but not much, if the server needs to do other things at the same time.

    Hope this helps.
    --
    Bill

    Old age and treachery will overcome youth and skill.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...