It seems I have not been clear enough. When the server accept()'s a connection I add the connection id to a hash so I will have a list of connection id's. Now when any data from any connection comes into the server I need the server to turn around and send that data out to all connections. This does work somewhat but the problem is that when the first user connects the thread is spawned and only ever sees itself. When the second one connects the thread is spawned and the id is added to the hash along with the first and now the second sees itself and the first. The third connects and sees itself and 1 and 2. However 1 cannot see 2 or 3 and 2 cannot see 3. This is because I can not share this list/hash with each thread.
Does this give you a better idea of what I am talking about now?
-
Are you posting in the right place? Check out Where do I post X? to know for sure.
-
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
<u> <ul>
-
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
intervention).
-
Want more info? How to link
or How to display code and escape characters
are good places to start.
|