Socket program - Unix

This is a discussion on Socket program - Unix ; I want to write a socket program in which there is a server and multiple clients. The server will list all the clients FD that are connected with the server. Now I want two clients to be communicated without the ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Socket program

  1. Socket program

    I want to write a socket program in which there is a server and
    multiple clients.
    The server will list all the clients FD that are connected with the
    server.
    Now I want two clients to be communicated without the server.
    Can I able to do that?
    This is similar to chat program.

  2. Re: Socket program

    On May 26, 9:24*pm, lak wrote:
    > I want to write a socket program in which there is a server and
    > multiple clients.
    > The server will list all the clients FD that are connected with the
    > server.
    > Now I want two clients to be communicated without the server.
    > Can I able to do that?
    > This is similar to chat program.


    I really don't understand what your question is. You are asking us if
    you are able to create a chat program? Given the lack of understanding
    in your question, I'd say probably not. Start with something simpler.

    DS

  3. Re: Socket program

    >I want to write a socket program in which there is a server and
    >multiple clients.
    >The server will list all the clients FD that are connected with the
    >server.


    Clients cannot use file descriptors of the server, if that's what
    you mean here. And you can't pass file descriptors around across
    systems.

    >Now I want two clients to be communicated without the server.
    >Can I able to do that?


    If you want that, you have to write code for that. The
    clients need to open sockets for client-to-client communication.
    One client needs to listen on a socket, and the other needs to
    initiate a connection (assuming you are using TCP). IP and
    port information presumably gets passed through the server.


+ Reply to Thread