How can I run a background process (or "on load process") at asp.net webservice
I'm buiding a webservice.
This webservice receive request from client, and tranform data to HSM to signature it. But it requires to connect/send-receive data/disconnect to HSM
I don't need to connect to HSM each receive a client requet, I want to open a connection to HSM when webservice run, and then send data to HSM via this TCP connection.
Can I do this with asp.net webservice?
开发者_如何学运维If yes, how can I do??
Many thanks
In your Global.asax
file add an Application_Start
handler and start the connection there.
Since you could have multiple web service calls on different threads which you seem to be all funneling through a single connection to HSM, you'll need to synchronize use of the HSM connection (use lock).
精彩评论