Logo Search packages:      
Sourcecode: pcsc-lite version File versions  Download package

LONG SCardCheckDaemonAvailability ( void   )

Checks if the server is running.

If the server has been restarted we invalidate all the PC/SC handles. The client has to call SCardEstablishContext() again.

Returns:
Error code.
Return values:
SCARD_S_SUCCESSServer is running (SCARD_S_SUCCESS)
SCARD_E_NO_SERVICEServer is not running (SCARD_E_NO_SERVICE)
SCARD_E_INVALID_HANDLEServer was restarted or after fork() (SCARD_E_INVALID_HANDLE)

Definition at line 3660 of file winscard_clnt.c.

References SCARD_E_NO_SERVICE, and SCARD_S_SUCCESS.

Referenced by MessageReceiveTimeout(), and SCardEstablishContext().

{
      LONG rv;
      struct stat statBuffer;
      char *socketName;

      socketName = getSocketName();
      rv = stat(socketName, &statBuffer);

      if (rv != 0)
      {
            Log3(PCSC_LOG_INFO, "PCSC Not Running: %s: %s",
                  socketName, strerror(errno));
            return SCARD_E_NO_SERVICE;
      }

      return SCARD_S_SUCCESS;
}

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index