Hi,
This post has 2 parts.
-----------------------------------------------------------------
I need your opinion on these concepts:
#define PCSCLITE_MAX_CHANNELS 16 /* Maximum channels */
#define PCSCLITE_MAX_APPLICATIONS 16 /* Maximum applications */
#define PCSCLITE_MAX_READERS 16 /* Maximum readers */
#define PCSCLITE_MAX_CONTEXTS PCSCLITE_MAX_READERS
I wish your opinion on what is for you a CHANNEL, a CONTEXT, an APPLICATION, a READER.
CONTEXT is related for the hContext or for the hCard?
For me a READER and a CONTEXT is different. Also in the code of readerfactory.c,
eventhandler.c et winscard_clnt.c there is many place where I wish replace
PCSCLITE_MAX_CONTEXTS by PCSCLITE_MAX_READERS.
I will try to explain you how I think theses concepts.
Fisrt imagine
- 3 PC/SC daemons started on 3 different hosts (it is possible to connect to PC/SC
daemons over the network with SCardEstablishContext -- it is not yet implemented in
PC/SC Lite):
PC/SC D1, PC/SC D2, PC/SC D3
- 4 applications :
App A, App B, App C, App D
2 readers R1 and R2 but where R2 has 2 slots that we call R2S1 and R2S2
Focus on PC/SC D1.
For me PCSC_MAX_APPLICATIONS is the maximum number of clients (with a different PID)
that the daemon PC/SC can accept. Here for example it may be 4.
Obviously PCSC_MAX_READERS (consider a slot as a reader) is here 3 (1 readers + 2
slots).
For me, we may be add PCSC_MAX_CONTEXTS_CLIENT that will be the number of
SCardEstablishContext calls that an application is allow to do. For example here it
may be 3.
Thus we may also introduce PCSC_MAX_CONTEXTS_SERVER that will be a maximum of
PCSC_MAX_APPLICATIONS*PCSC_MAX_CONTEXTS_CLIENT.
PC/SC D2
\ (1)
------ -------- R1
\ / \ /
App A PC/SC D1--R2S1
\ / | | | \
-------- | | | R2S2
(2) | | |
PC/SC D3 | | |
\ | | |
-------App B -----------/ | |
| |
App C -------------/ |
|
App D ---------------/
On each CONTEXT we may imagine to call many time SCardConnect creating a CHANNEL on it
each time. On each CONTEXT it may be a maximum of PCSC_MAX_CHANNELS.
But we need to introduce a PCSC_MAX_CHANNELS_CLIENT_SIDE and
PCSC_MAX_CHANNELS_READER_SIDE because for example all the applications over all the
context may want access to the same READER (i.e. card).
Note: The App A has 2 CONTEXTs because for example it may be create 2 threads and each
thread wishes to call SCardEstablishContext.
-----------------------------------------------------------------
What is the need of dwBlockStatus in PREADER_CONTEXT structure ?
I have the same question about the functions :
- RFUnblockReader
- RFUnblockContext
-----------------------------------------------------------------
I wait your feedbacks on these concepts.
Damien Sauveron.
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
_______________________________________________
Muscle mailing list
[EMAIL PROTECTED]
http://lists.musclecard.com/mailman/listinfo/muscle