Hello! I'll be happy if someone will share their thought with me about this
Basically when
listen(unsigned short port);
is called like this
class C
{
TcpListener l;
public:
C() { l.listen(53000); };
};
C c;
int main()
{
return 0;
}
it prints in console
Failed to create socket
but if it's called like this
class C
{
TcpListener l;
public:
C() { l.listen(53000); };
};
int main()
{
C c;
return 0;
}
it's all good. Only difference I'm spotting is that in second variant, call is inside the main(). I want to know why is that happening, maybe I'm missing something. And is it connected with location like I noticed?