chat program using linux networking - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

chat program using linux networking

Hi everyone,
I have just started network programming on linux and i wrote some very basic client-server programs. My university has a lan and i thought it would be fun to write a chat program for the lan, but i dont know how to proceed, can anyone help me out?

Thanks

Comments

  • gustavo-serragustavo-serra Posts: 21Member
    Maybe you could fork your main process into two:

    The father will read user input and send it through the socket.
    The son will receive data and display it on the screen.

    If I am right, you can't use the same socket for both son and father, as the file descriptor (the socket) is not shared among them. Each process (father and son) will open its own connection. You could also use a thread, which I think that would make your job a lot easier.

    Anyway, it is an idea.
    Good luck!
  • gustavo-serragustavo-serra Posts: 21Member
    Maybe you could fork your main process into two:

    The father will read user input and send it through the socket.
    The son will receive data and display it on the screen.

    If I am right, you can't use the same socket for both son and father, as the file descriptor (the socket) is not shared among them. Each process (father and son) will open its own connection. You could also use a thread, which I think that would make your job a lot easier.

    Anyway, it is an idea.
    Good luck!
  • gustavo-serragustavo-serra Posts: 21Member
    Maybe you could fork your main process into two:

    The father will read user input and send it through the socket.
    The son will receive data and display it on the screen.

    If I am right, you can't use the same socket for both son and father, as the file descriptor (the socket) is not shared among them. Each process (father and son) will open its own connection. You could also use a thread, which I think that would make your job a lot easier.

    Anyway, it is an idea.
    Good luck!
  • sohbetisohbeti Posts: 58Member
    This post has been deleted.
Sign In or Register to comment.