1. Namespace and socket errors?

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?

new topic     » topic index » view message » categorize

2. Re: Namespace and socket errors?

Mihail121 said...

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?

Mihail121 said...

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.

new topic     » goto parent     » topic index » view message » categorize

3. Re: Namespace and socket errors?

jimcbrown said...

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?

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu