Hi all,
Here is my question. I want to
add access control to my PCAS, but I do not know what
the pUserName and pHostName in the following function refer to
clearly.
virtual casChannel *createChannel ( const casCtx
&ctx,const char * const pUserName,const char * const
pHostName);
In "Channel
Access Protable Server API Tutorial" it said that
points to a string representing the user's name
and pHostName points to a string representing the
server tool's host. For example, I have two EDM clients application run on the
same linux PC, does the user's name refer to the PC name or something
else.
I have
implemented the createChannel function and writeAccess function like
this:
casChannel *exPV::createChannel ( const casCtx &ctx,
const char * const /*pUserName*/,
const char * const /*pHostName*/)
{
return new exChannel ( ctx,"zhangyul","Administrator");
}
///////////////////////////////////////////////////////////////////
bool exChannel::writeAccess () const
{
if (strcmp(User.string(), "zhangyul") == 0)
return aitFalse;
else
return aitTrue;
}
However, I found that any client could not write the PCAS's PV, I think my
understanding is totally wrong about user's name and the host name!!
Thank you!
Zhang
Yuliang