I am haveing trubble with the tcpstream() constructor and/or the operator! function.
What I'm doing is simply this:
tcpstream server; // should create an unopened tcpstream
while(!server) { // while not open
server.open(servers.get()); // try to open
}
where servers is a class with a circular linked list of servers.
But it never gets to the server.open() part.
if I remove the ! it gets stuck in the while.
It looks to me that it thinks the tcpstream is open when I created it with no parameters.
Or is it just me being stupid?
//Olle
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hey. I upgraded to 0.9.5 today and I noticed that you have written
inline bool operator!()
{return Socket::state == SOCKET_CONNECTED;};
instead of
inline bool operator!()
{return Socket::state != SOCKET_CONNECTED;};
as it should be.. this error is in 0.9.4 too..
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi.
I am haveing trubble with the tcpstream() constructor and/or the operator! function.
What I'm doing is simply this:
tcpstream server; // should create an unopened tcpstream
while(!server) { // while not open
server.open(servers.get()); // try to open
}
where servers is a class with a circular linked list of servers.
But it never gets to the server.open() part.
if I remove the ! it gets stuck in the while.
It looks to me that it thinks the tcpstream is open when I created it with no parameters.
Or is it just me being stupid?
//Olle
In the socket.h header, under class tcpstream, replace:
inline bool operator!()
{return Socket::state == SOCKET_INITIAL;};
with
inline bool operator!()
{return Socket::state != SOCKET_CONNECTED;};
This should produce the behavior you are looking for and should be
changed by the next release.
Thank you, that worked fine.
It's a really nice library you've got there, keep up the good work!
Hey. I upgraded to 0.9.5 today and I noticed that you have written
inline bool operator!()
{return Socket::state == SOCKET_CONNECTED;};
instead of
inline bool operator!()
{return Socket::state != SOCKET_CONNECTED;};
as it should be.. this error is in 0.9.4 too..
You are correct...oops!