1 client and multiple server

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • abhi147@gmail.com

    #1

    1 client and multiple server

    Hi ,
    I have one client and 4 servers (A,B,C,D) , The client reads
    a message from message queue and sends messages to servers so that it
    sends the 1st message to server A , then the next message to server B ,
    next one to C then D , then again starts the cycle .
    Can anyone help me ?

    Thanks !

  • kulkarni.sunil@gmail.com

    #2
    Re: 1 client and multiple server

    abhi147@gmail.c om wrote:
    Hi ,
    I have one client and 4 servers (A,B,C,D) , The client reads
    a message from message queue and sends messages to servers so that it
    sends the 1st message to server A , then the next message to server B ,
    next one to C then D , then again starts the cycle .
    Can anyone help me ?
    >
    Thanks !
    What help do you need? If you want help with iteration logic,
    here is some crude example in C

    <-- begin: uncompilable, untested crude code snippet -->

    void * server_list[4] = {A, B, C, D};
    void * message;
    unsigned int i = 0;
    while (some_condition ) {
    message = get_one_message _from_client_qu eue();
    send_message_to _server(message , server_list[i % 4]);
    i++;
    }

    <-- end: uncompilable, untested crude code snippet -->

    Comment

    Working...