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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Client Server Multithreaded

Status
Not open for further replies.

TerribleTim

Programmer
Dec 23, 2004
2
US
I'm writing a simple client/server program in python, and I think I need to use threads or forks or somthing, but I don't know what command I'm looking for.

Currently I have seperate client and server programs, they work fine, I can send a message from the client and the server receives it. What I want is for both computers to act as client and server (think chat).

When I try to combine them, I get stuck in an infinate loop of the server waiting for the client to send it some data, therefore I can't get the place to input some data for the client to send.

So how can I get these both working at once?
 
You probably need to rethink your architecture. If you want peer-to-peer communication you would structure the event handlers differently. Without a little more insight into how your trying to make it work that's about the best I can do.
 
Indeed I am trying to write a P2P app, but I thought I would start with a simple chat. I am planning to use wxWidgets, but first I am trying to get it to work in terminal. I am using the Twisted framework for networking, and Boa Constructer to code in. If you could point out a good tutorial or just give me an idea of what terms to search for it would be most helpful. Espcially what kind of event-handlers does Python have?
 
Python doesn't have event handlers, that would come from your add on packages.

Honestly, you're using so many different frameworks that you've really exited the realm of python language questions. All I can tell you is read the docs on the frameworks, understand and find a developers forum specific to them or else ditch 'em.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top