Page 2 of 2

Re: FreshLib первые шаги.

Posted: Wed Oct 24, 2012 12:07 pm
by johnfound
hidnplayr, I have some problems with SocketListen. It returns immediately with eax=0 exactly as it has connection. But SocketAccept that always fails with eax = -1.

KolibriOS r2991, autobuild: 22.10.2012;

BTW, this build has some problems with the keyboard - some keys does not work: "d" and "r" for example (although "D" and "R" work)

Re: FreshLib первые шаги.

Posted: Wed Oct 24, 2012 12:37 pm
by johnfound
Sorry, I am wrong here. SockAccept should block until new connection appears. But it does not block at all. How SockAccept should be processed in KolibriOS?

Re: FreshLib первые шаги.

Posted: Wed Oct 24, 2012 2:14 pm
by johnfound
Next problem (it is not exactly problem, but some kind of inconsistency) f.75 handles the IP address as an normal little-endian number - $7f000001 == 127.0.0.1 (at least the display on the debug board show it this way), while the port as a big-endian number - $901f == 8080;

What can be the reason for SockAccept (fn.75.5) to exits immediately with error. What are the valid values for edx and esi?
I tested to bind the socket (fn.75.2) to arbitrary addresses and it always ends with eax = 0 (i.e. OK)

Re: FreshLib первые шаги.

Posted: Wed Oct 24, 2012 2:32 pm
by hidnplayr
All socket functions are non blocking, a network event is generated upon.. you guessed it.. any network event.
Thus if you want to block, wait for event or poll.

Little/big endian issues are mistakes on my side and will be corrected in kernel.
How is it in windows/linux (the endianess ?)

EDIT: I will implement blocking sockets in kernel so you can choose to use blocking or non blocking
EDIT2: Bind does not check the addresses yet, i'll add it to my list ;)

Re: FreshLib первые шаги.

Posted: Wed Oct 24, 2012 4:14 pm
by johnfound
hidnplayr wrote:How is it in windows/linux (the endianess ?)
AFAIK, both Windows and Linux use big-endian notation for internet addresses - so called network byte order at least for IP addresses.
EDIT: I will implement blocking sockets in kernel so you can choose to use blocking or non blocking
EDIT2: Bind does not check the addresses yet, i'll add it to my list ;)
So, I will pause a little the sockets tests. Please, let me know when you are ready.

Regards.

Re: FreshLib первые шаги.

Posted: Thu Nov 01, 2012 3:38 pm
by hidnplayr
The big/little endian issues should be fixed now (IP and port numbers are big endian aka network byte order now)

Re: FreshLib первые шаги.

Posted: Thu Nov 01, 2012 5:24 pm
by johnfound
Thanks. Tonight I will test it with phWeb server and will fix everything in the library.

Re: FreshLib первые шаги.

Posted: Thu Nov 01, 2012 8:58 pm
by johnfound
I fixed the byte order and it seems to be OK now. But still can't set the socket to be blocked. I studied the sources of r2995, but couldn't find any way to set SOCKET.options to SO_BLOCK...

Re: FreshLib первые шаги.

Posted: Sun Mar 02, 2014 3:03 am
by Mario_r4
Хотелось бы знать каково реальное положение, прогресс или его отсутствие. Так хорошо все начиналось...