View Single Post
Join Date: Dec 2006
Posts: 1,089
Reputation: vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all vijayan121 is a name known to all 
Solved Threads: 164
vijayan121 vijayan121 is offline Offline
Veteran Poster

Re: UDP-Sockets chat application question

 
0
  #2
Nov 17th, 2008
First, is this the "best" way to tackle the chat problem?

no. it is unlikely that someone would want to set up a chat between two processes on the same machine, sharing stdin and stdout between them. write two separate programs; the server and the client. which can be run on different machines.


> each time i try to send something from app1 to app2.
> app2 never receives the msg... but instead app1 does! why?

i've only had a cursory look, but:
the forked child process has its own copy of the parent's descriptors.
but these descriptors reference the same underlying objects as the parent.
both the parent and child processes are using the same socket, same stdin etc.
Reply With Quote