Single Slot Multiple Client Architecture

I need to maintain one permanent connection of sockets to the payment gateway and use it to send financial messages and receive confirmation for it. My application will then be used by various clients, and therefore I need to develop a way to handle them simultaneously and handle issues like timeouts and retries, etc.

Right now, my main problem is accessing the socket ... should I just block sending and returning to the request and reply to the message, or configure the queue system and match them? I will also send periodic echoes to another thread.

Oh, and I plan to do it in C #. I would appreciate some general guidance on this.

+3
source share
2 answers

You need a permanent socket for the payment gateway, ok. By this, I assume that you mean that he should stay in touch.

Then you need to create a socket listener to listen for connections from your clients. Then act as a translator between them.

I'm not sure I understand what you mean by "socket lock". Block it how?

, , , . - - . .

+1

( ). , , , . (), ? , .

. , , , . , , . , , , .

, , , , , , , . , .

+1

Source: https://habr.com/ru/post/1703487/


All Articles