Board.KolibriOS.org

Official KolibriOS board
It is currently Wed Apr 24, 2019 7:48 am

All times are UTC+03:00




Post new topic  Reply to topic  [ 24 posts ]  Go to page Previous 1 2
Author Message
PostPosted: Wed Oct 24, 2012 12:07 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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)


Last edited by johnfound on Wed Oct 24, 2012 2:13 pm, edited 1 time in total.

Top
   
PostPosted: Wed Oct 24, 2012 12:37 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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?


Top
   
PostPosted: Wed Oct 24, 2012 2:14 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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)


Top
   
PostPosted: Wed Oct 24, 2012 2:32 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1247
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 ;)

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Wed Oct 24, 2012 4:14 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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.

Quote:
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.


Top
   
PostPosted: Thu Nov 01, 2012 3:38 pm 
Offline
Mentor/Kernel Developer
User avatar

Joined: Fri Jun 30, 2006 9:01 am
Posts: 1247
The big/little endian issues should be fixed now (IP and port numbers are big endian aka network byte order now)

_________________
"Any intelligent fool can make things bigger, more complex, and more violent. It takes a touch of genius -- and a lot of courage -- to move in the opposite direction." Albert Einstein


Top
   
PostPosted: Thu Nov 01, 2012 5:24 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
Thanks. Tonight I will test it with phWeb server and will fix everything in the library.


Top
   
PostPosted: Thu Nov 01, 2012 8:58 pm 
Offline

Joined: Fri Feb 18, 2011 3:13 pm
Posts: 201
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...


Top
   
PostPosted: Sun Mar 02, 2014 3:03 am 
Offline
Kernel Developer

Joined: Sun Feb 10, 2013 12:37 pm
Posts: 2329
Хотелось бы знать каково реальное положение, прогресс или его отсутствие. Так хорошо все начиналось...

_________________
Всем чмоки в этом проекте! Засуньте эти 11 лет себе в жопу!


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 24 posts ]  Go to page Previous 1 2

All times are UTC+03:00


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited