By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
439,985 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 439,985 IT Pros & Developers. It's quick & easy.

inter threading info

P: n/a
Hi All,

Q: Is it possible for a thread on SocketServer.ThreadingTCPServer to get
the socket info of *other* open thread/s and use that info to send data
to the accepting client?

I wrote a socketserver using SocketServer.ThreadingTCPServer. A client
is connected to the server and expects multiple request/responses. (Not
sure about the terminology but the client connects and then stay
connected for a while.)

I need to create a client that can connect to server and then determine
how many other clients are connected, what the socket info is
(ifile/ofile) and then send and receive specific data to those clients.

TIA
T
Jul 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Tertius Cronje wrote:
Q: Is it possible for a thread on SocketServer.ThreadingTCPServer to get
the socket info of *other* open thread/s and use that info to send data
to the accepting client?
A specific socket can be used from every thread of a process. Just make
sure that you synchronize everything.
I need to create a client that can connect to server and then determine
how many other clients are connected, what the socket info is
When you accept a socket client, a new socket is created, so you cannot
determine how many clients are connected to a socket. You have to create
a data structure where you insert info about accepted connections and
delete the info when a connection is closed.
(ifile/ofile) and then send and receive specific data to those clients.


ifile/ofile are local to the server process so you cannot use them to
send data from one client to another client. You have to send the data
to the server first with a special tag, the server has to use that tag
and send the data to the designated other client.

It sounds a bit as if you want to build some kind of chat server and now
you want to add private channels.

Daniel

Jul 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.