On Thu, 04 Dec 2008, Francesco Saverio Giudice wrote:

Hi Francesco,

> I'm working with Inet*() functions and hblog.
> In my repository I have updated Inet with RAW connections, actually UDP raw 
> connections, and packets manipulation (I need to spoof IP for a specific 
> application).
> All works well in non MT env.
> Now I'm trying to test this app in MT environment.
> Questions: did you gave a look to hblognet and THREAD version ?

No, I'm not familiar with hblog* code. Anyhow if it operates on
separated resources then is should be safe. But to say sth more
I will have to look at this code.

> Is it INET is already MT safe and functional also if its source is in rtl 
> folder ?

There is one problem which have to be fixed in *inet functions.
The name resolving is not MT safe. Just simply OS inet functions
gethostbyaddr() and gethostbyname() are not MT safe. For some
platforms there are alternative functions which can be used as
workaround unfortunately they are not standard ones. In general
functions which calls hb_getHosts() internally are not MT safe.
These are: HB_INETGETHOSTS(), HB_INETGETALIAS(), HB_INETCONNECT().
In xHarbour documentation Giancarlo described it (see doc/inet.txt)
I will work on INET module adding C API and I'll resolve it for
some platforms and for other I'll try to add some workarounds
or describe limitations.
Now I'm busy working on some other things so I cannot say when
exactly I will find time to make it.

> In hblognet there are commands like:
> StartThread( Self, "AcceptCon" )
> How make equivalent using Harbour Thread functions that, AFAIK, I have seen 
> that don't support Objects, or there is another way to implement Threads 
> with Objects ?
> Could it be correct to define hb_ThreadStart( {|| ::AcceptCon() } ) ?

Yes it's correct.

In Harbour object with character message name in next parameter as
thread  start point is not supported intentionally. If you need then
create simple wrapper function though I suggest to not use it.

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

Reply via email to