I'm starting to get the idea that tcpstreams and their ilk are meant to be used only on the heap. For a client connection, I was trying to reuse a TCPStream object by calling connect when it lost its connection, but I quickly realized that connect is a protected method. Since the client isn't using threads I switched to tcpstream, which solved the problem somewhat since I could use the open method. However, the way I'm detecting if the server shut down is with getErrorNumber. But the error id never gets reset to errSuccess once an error occurs.
My only recourse seems to be to create the tcpstream on the stack and delete it and create a new one when a new connection needs to be made.
My question is, is this a design philosophy or am I misunderstanding something? Is there a way to reuse tcpstreams on the stack?
BTW: Thanks for this library, it's saved me some headaches!
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm starting to get the idea that tcpstreams and their ilk are meant to be used only on the heap. For a client connection, I was trying to reuse a TCPStream object by calling connect when it lost its connection, but I quickly realized that connect is a protected method. Since the client isn't using threads I switched to tcpstream, which solved the problem somewhat since I could use the open method. However, the way I'm detecting if the server shut down is with getErrorNumber. But the error id never gets reset to errSuccess once an error occurs.
My only recourse seems to be to create the tcpstream on the stack and delete it and create a new one when a new connection needs to be made.
My question is, is this a design philosophy or am I misunderstanding something? Is there a way to reuse tcpstreams on the stack?
BTW: Thanks for this library, it's saved me some headaches!