The above is not true. This functions is implemented in the worst
possible way for performance. It calls recv() to extract single byte.
It means that the cost of switching between user and kernel space
is horrible huge and can kill the performance. I've seen how slow
it can be in some small programs written for pocket PC with WinCE.
The problem can be resolved by introducing internal buffer to
HB_SOCKET_STRUCT used by hb_inet*() functions and reading data in
bigger peaces. But it also means that we will have to update other
hb_inet*() functions to respect data in this buffer which can appear
after calling hb_InetRecvLine() or hb_InetRecvEndBlock() and I do
not know if I should invest time in cleaning this whole interface.
Maybe we should think about writing new one from scratch using
new hb_socket*() C functions?

IMO definitely. I find current HB_INET*() interface very clumsy,
inconsistent. It'd also be better to have a high-level interface
which resembles the low-level one. So my vote for a new one and
keeping the old one for compatibility.

How many people use current hb_inet*() functions and how important
is backward compatibility for you?

In Harbour only hbtip and terminal. Plus two examples use proprietary
API, probably because above reasons.

Brgds,
Viktor

_______________________________________________
Harbour mailing list
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to