Hi All,
Looking for some advice. I have created a small application to push a "text" string to multiple client over multiply TCP connections. All clients will receive the same string at a time interval therefore very little client management is required (no client requests). I have been using a array of sockets and astreams and as a new connection comes in it attaches to the next available socket and astream. Originally I captured what sockets/astreams were being used and only wrote (astream.write) to the connected astream outputstream. As I refined the code I accidentally wrote to all astream outputsstreams in the array regardless of connection state. To my surprise it worked and didn't throw an error. If this is a valid use and if doesn't cause memory leaks or stack problem it can reduce the client management code by heaps.
In short :
Can using astream.Write to an unconnected astream object without causing an issue or problem?
Jason
Looking for some advice. I have created a small application to push a "text" string to multiple client over multiply TCP connections. All clients will receive the same string at a time interval therefore very little client management is required (no client requests). I have been using a array of sockets and astreams and as a new connection comes in it attaches to the next available socket and astream. Originally I captured what sockets/astreams were being used and only wrote (astream.write) to the connected astream outputstream. As I refined the code I accidentally wrote to all astream outputsstreams in the array regardless of connection state. To my surprise it worked and didn't throw an error. If this is a valid use and if doesn't cause memory leaks or stack problem it can reduce the client management code by heaps.
In short :
Can using astream.Write to an unconnected astream object without causing an issue or problem?
Jason
Last edited: