Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need multiple processes to share a variable 1

Status
Not open for further replies.

zombieZero

Technical User
Apr 7, 2004
28
US
I feel like I'm missing something obvious here, but if anyone could help I'd appreciate it. Basically, I've got a TCL analyzer that captures packets. So that the capture can run at the same time as the generator, I spawn the generator as a new process using a standalone tcl script. This works, but sometimes they get a little out of synch...

What I really want to do is to have the generator give the analyzer the 'ok' to begin the capture only once the packets are just about to go out.

Since they are different processes, the TCL objects are not able to see one another and can't share variables...but I thought maybe I could use an environmental variable that both processes could see as a 'toggle' the generator could set and which could act as a trigger for the analyzer to start the capture.

Does anyone have an idea how this can be accomplished?

Thanks!
 
You don't post any code but from your description, it seems like a perfect situation for a client/server socket implementation. Is there any reason you don't want to do that?

_________________
Bob Rashkin
 
Yeah...it was right there in front of me the whole time. I've been working with client/server sockets too(!)

I went ahead and added a piece to create a server socket in the tester constructor - when the generator script runs, I just have it connect as a client and send the OK. Works like a champ ;)

Thanks once again, Bong - you truly are the man!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top