sending structure in client server..

Discussion in 'C Programming' started by swetha, Oct 11, 2008.

  1. swetha

    swetha Guest

    Hi ,
    I want to send a structure (user defined) for example :

    struct bank{

    int empid;
    char name[50];
    float amount;

    } per;

    I want to send this from a client to server on unix.Can any1 tell me
    how to send this(from client) and read the data at the other end(at
    server).tnx in advance...
     
    swetha, Oct 11, 2008
    #1
    1. Advertisements

  2. swetha

    vippstar Guest


    Ask in an appropriate newsgroup. <comp.unix.programmer> might help
    you.
    Unix, networking et cetera are off-topic here in <comp.lang.c> where
    only the C language is discussed.
     
    vippstar, Oct 11, 2008
    #2
    1. Advertisements

  3. Assuming the client and server are both running on the same machine,
    there are a wide variety of options available to you, and without
    further information about your setup, it's hard to recommend one in
    particular. For example, you could use named pipes, shared memory or
    sockets. If the client and server are running on different machines,
    you'll need to rely on the last of those options...

    To find out more, "interprocess communication" or "IPC" would be a good
    term to Google. If you want more guidance here, you'll need to describe
    your application in more detail.
     
    Antoninus Twink, Oct 11, 2008
    #3
  4. If you want more guidance here, you'll be asking in the wrong place.
    comp.unix.programmer is full of Unix experts, most of whom know more
    about this stuff than most of the people here. "Antoninus Twink", for
    whatever reason, apparently doesn't want you to know that.
     
    Keith Thompson, Oct 11, 2008
    #4
  5. isn't that a rather atypical Client Server application?
    Yes, I know it happens but wouldn't it be more reasonable
    to assume the Client and Server were on different machines.
    Maybe utterly different hardware.

    To the OP: try a Unix newsgroup and ask about sockets.

    <snip>
     
    Nick Keighley, Oct 12, 2008
    #5
  6. I'd hardly call it atypical. How many daemons are running on your
    machine at the moment waiting for local connections? Are you running X
    Windows at the moment with local client programs?

    The OP didn't give us enough information to tell what his setup was: I
    gave advice (which you snipped) that deals with both situations.
     
    Antoninus Twink, Oct 12, 2008
    #6
  7. swetha

    Ian Collins Guest

    He did, yesterday.
     
    Ian Collins, Oct 12, 2008
    #7
  8. swetha

    Ian Collins Guest

    Plenty and they also accept and correctly process remote ones. Fool.
     
    Ian Collins, Oct 12, 2008
    #8
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.