hi quick question
can you communicate variubles between forks and if so how
hi quick question
can you communicate variubles between forks and if so how
Inter-Process Communication (IPC) techniques are what you're interested in.
This looks like some decent documentation on IPC in Linux: http://tldp.org/LDP/lpg/node7.html
gg
how about taking a recived message and reading the ip address from it.
agein is it possible and how is it done
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
ok i got the forking thing to work, i broadcast between a few servers to find a file. if a server has the file it replies to the broadcast but i need to find out the ip address for that replying server from the message is it possible?
the next stage will be to use that ip address to create a tcp connection and transfering the file
I'm sure it's possible, but I still think this is a typical "threads rather than forks" task.
Either way, I'm sure that the simplest solution is for the server to just add it's own IP address to the message when it responds to the broadcast - after all, the server must know who it is, right? [And don't worry about the extra data, it's only 4 bytes if you do it right].
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.