1. Namespace and socket errors?
- Posted by Mihail121 Feb 06, 2011
- 1153 views
Ok, this code:
socket connectionSocket = create(AF_INET, SOCK_STREAM*50, 0)
returns -38 and causes a type_check failure where it should return -1 according to documentation?
Also
include std/socket.e socket connectionSocket = sockets::create(AF_INET, SOCK_STREAM*50, 0)
gives an error <0032>:: an identifier is expected here
Am I doing something wrong?
2. Re: Namespace and socket errors?
- Posted by jimcbrown (admin) Feb 06, 2011
- 1155 views
Ok, this code:
socket connectionSocket = create(AF_INET, SOCK_STREAM*50, 0)
returns -38 and causes a type_check failure where it should return -1 according to documentation?
Hmm. At first I'd say the documentation is wrong, because -38 is valid return code (that signifies an error), but if that's the case then it should not be causing a type check error.
Anyways, -38 means the socket type is not supported. This is correct, as SOCK_STREAM*50 doesn't represent a valid socket type.
What are you trying to accomplish by multiplying SOCK_STREAM by 50?
Also
include std/socket.e socket connectionSocket = sockets::create(AF_INET, SOCK_STREAM*50, 0)
gives an error <0032>:: an identifier is expected here
Am I doing something wrong?
That should be
include std/socket.e socket connectionSocket = sockets:create(AF_INET, SOCK_STREAM*50, 0)
That is, only use one colon (:), not the double colon (::) that C++ uses.
3. Re: Namespace and socket errors?
- Posted by Mihail121 Feb 06, 2011
- 1173 views
Hmm. At first I'd say the documentation is wrong, because -38 is valid return code (that signifies an error), but if that's the case then it should not be causing a type check error.
Anyways, -38 means the socket type is not supported. This is correct, as SOCK_STREAM*50 doesn't represent a valid socket type.
What are you trying to accomplish by multiplying SOCK_STREAM by 50?
Absolutely nothing, just tested to see if the documentation is consistent which is not the case. Should I submit a report of some sorts or? And thank you for the help.
Can somebody else verify the scenario?