EmbLogic's Blog

Client Server using Pipes

Any updates for client server application using pipes

13 Responses to Client Server using Pipes

  1. Kopal says:

    i m still in the initial phase….i am working with strings as demo to be able to communicate among the server,process clients and the requesting clients….as soon as i m able to do it….i will extend it to various clients with different opetrations…..

  2. spatlou says:

    you can send file descriptors using sprintf()

  3. Ankit.e1 says:

    This is what I have done till now…

    #1 I took a pipe, in the server process, call it master pipe.and two more pipes and passed them to clients as an argument for further use.

    #2 Then I forked two clients in the server using execlp, and passed that master pipe in the client as an argument.

    #3 From the two clients I made the second client sleeping for 5 secs. So that the other client’s scanf operations can be performed at an ease.

    #4 The server read the info from the master pipe. and according to that info :: if the client wanted to do add or multiply it had choices 1 or 2, for various processing clients.

    #5 If choice is relevant the server sends the info from the client process to the processing client using another pipe.

    #6 The information gathered by the processing client is processed
    and the result is written on the pipe common between processing client and the calling client.

    This is done but how to handle multiple clients efficiently is still an issue, and will be resolved soon. fork(), waitpid(),execlp() concepts have to very strong to do this.

  4. agrita.e1 says:

    i am in initial level…i have created three client it returns the value through arguments using string.i am working on communication with server . i am trying to write strings in master pipe but it is not able to read anything…..

  5. arjita.e1 says:

    i am working on communication among clients and server .i have passed string as argument…but clients are not able to write on master pipe(server) and still trying to do this…..

  6. Amit Gemini says:

    have done client_server using pipes for only one Request_client & request_Process, where client send request to Server and then server read the request from the client and send it further client for processing and than the result send back to the requested client directly by processing client not through server.

    Now me planning to create a header file which contains the structure i.e ( char operator, int op1 and op2) and this structure will be share by all the client.
    to use a common structure, it well understandable format to pas information between different clients.
    i am looking for it.

    and other thing, how synchronization should be done for multiple clients so that there is no loss of data and the resulted data should be delivered to the requested client only.

  7. sumit.e2 says:

    I prepared client server application where i have three process first is main process(SERVER) second one is request_client and third one is processing_client.

    In this application request_client request to server and then server send a request to processing_client and then processing_client send a requested output to requested_client directly.

  8. Kopal says:

    I have done the following by now:-

    made two diffrent programs for two different CLIENTS, both writing in the same FIFO

    the SERVER reads one of the CLIENT and performs the corresponding operation and then it further requests corresponding PROCESSING_CLIENT by writing into a particular FIFO for a particular PROCESSING_CLIENT

    the PROCESSING_CLIENT then sends the result to the REQUESTING_CLIENT directly

    by now i have to execute the processing clients manually…..soon i will do it using exec

  9. have completed the two way communication,started with the server assignment.

  10. Kopal says:

    I have done the following:
    1 to add
    2 to multiply
    3 to subtract

    u have to enter a choice:
    enter the first operand :
    enter the second operand:

    and u get the corresponding result

    I have used exec in the client for the server…..and exec in the server for the processing clients.

    As a user one just have to enter the operation and the two operands…..and what happens internally(ie.data flow) is an abstraction for the user

    i still have to work with shell scripts

  11. Kopal says:

    i have this problem in scripts…..
    once i execute it using ./program_name….it does not wait for scanf….so i m not able to give the choices and the operands…through the keyboard

    • even i m also facing the same problem..
      in my code its takes the first input but on entering the second and third input it does not wait after second input so one input is being skipped…

  12. I am also working on the same problem…
    Here in this i have created a server and multiple clients. In this the server takes the request from client and forward it to the appropriate client which process the request and forwards the result directly to the requesting client..

    The problem is that i am taking standard I/P but i am not able to send integer value …
    plz tell me how to send integer data on pipe.. or tell me some other way so that i can transmit a structure with operator and arguments..

Leave a Reply to sumit.e2 Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>