On Sat, 16 Jan 2010, Szak�ts Viktor wrote:

Hi,

> Probably RPC trace output will be best to direct into separate 
> console or separate section of the console, or file.

For final tool yes. Anyhow I think that we should reactivated
original trivial code in /hbnetio/tests directory. Now it begins
to be a little bit complicated code so it's not trivial example
for users who want to understand how it works and use it in their
own programs.

> BTW, why can I launch multiple server instances on same 
> iface/port? (on Win7) Should the second one exit with 
> error?

The second instance should fail because it should not be possible
to bind two connection sockets with thew same port. Don't ask me
what Win7 plans to do which such sockets.

> Another issue with HB_STRCLEAR().
> Client won't be able to connect, if I start the server like this:
> ---
>    netiosrv[ _NETIOSRV_pListenSocket ] := ;
>       netio_mtserver( netiosrv[ _NETIOSRV_nPort ],;
>                       netiosrv[ _NETIOSRV_cIFAddr ],;
>                       netiosrv[ _NETIOSRV_cRootDir ],;
>                       iif( Empty( netiosrv[ _NETIOSRV_cRPCFHRB ] ), netiosrv[ 
> _NETIOSRV_lRPC ], hb_hrbGetFunSym( netiosrv[ _NETIOSRV_cRPCFHRB ], 
> _RPC_FILTER ) ),;
>                       @cPassword )
> 
>    netiosrv[ _NETIOSRV_lEncryption ] := ! Empty( cPassword )
>    hb_StrClear( @cPassword )
> ---
> If I deleted HB_STRCLEAR() call it's OK.
> I's also OK if I deleted "@" from "@cPassword" in netio_mtserver() call.

It's expected. You are clearing the only one copy of cPassword variable
before it's used for incoming connections.
Instead of:
   hb_StrClear( @cPassword ) /* Attempt to clear plain text pw from memory */
You should make:
   cPassword := NIL

BTW:
         hb_StrClear( @cParam )
         hb_StrClear( @aParam[ cParam:__enumIndex() ] )
above two calls are redundant. cParam is exactly reference to
@aParam[ cParam:__enumIndex() ] so the second call operates on
the same item so only the 1-st one is significant. You can also
remove:
   aParam := hb_AParams()
and use:
   FOR EACH cParam IN { ... }

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
[email protected]
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to