Re: Namespace and socket errors?

new topic     » goto parent     » topic index » view thread      » older message » newer message
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 thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu