zemuldo / iso_8583

:credit_card::moneybag: JavaScript library for iso 8583 messaging. Handles message validation & conversion between interfaces using iso 8583 standard. Contributors are welcome.
https://zemuldo.github.io/iso_8583/
MIT License
87 stars 53 forks source link

Does it keep the connection alive for two way communication between client and server #90

Closed rakeshfern closed 4 years ago

rakeshfern commented 4 years ago

If server return the iso message and client writes back to server and server returns another message after client writes concurrently is this process works on this?

zemuldo commented 4 years ago

This library just does message manipulation which can be anything from validation, conversion, safe logging, and metadata reading, etc.

As for the communication between your client and server, that is up to you. There is an example in the repo here. You can check that out.

The communication between interfaces which in most cases is TCP/IP via Socket, the data is exchanged in async mode, Therefore you cant keep the connection alive because the socket does that. As long as the socket is alive, the connection is alive. To persist a session like comms within that connection, you can mark your messages with a static header or use any special field in ISO 8583 specification to store data that represents a session that needs keep alive.

I hope this answers your question because apart from this, there is not much I can say as the conn between your client and your server is out of scope for this library. It just does message parsing/conversion between them.

rakeshfern commented 4 years ago

Thanks am looking for concurrent request and response from server and client for iso message processing using node js that is the major purpose of iso message parsing only message conversion will not help.

zemuldo commented 4 years ago

What you are looking for is not easy to include in a library. Concurrency should be something to implement on your application level. Nodejs does not guarantee concurrency without clustering or task spawning.

So unless you are suggesting we implement concurrent tasks in the library itself and I don't think its a good idea.

Would provisioning async/promise-based API provide you with 'concurrency'?

rakeshfern commented 4 years ago

i am looking to achieve this in node js itself without going for any specific language in application level. The scenario was this tcp client should wait for the response from server once the client write some iso message to the server and server keep on sending echo message iso sign on response to the client and the client writes back to server and server responds with echo message full duplex transmission with single socket channel this could be achieved in node js ?

zemuldo commented 4 years ago

Please check the example. There is an implementation using event emitter module and echo messages between server and client exchanging 800 network message type per few seconds.

As for full duplex comm, sockets are full duplex by default (how i see them). I am sure if you check that example you will find what you are looking for.

rakeshfern commented 4 years ago

Thanks let me check .Does it keep on echo messages between client and server.Suppose a signon request coming from server and signon request acknowledgement sent by the client and then a signon response comes from the server and the client acknowdges the signon response and send again back to the server.

zemuldo commented 4 years ago

All this can be done once you have an authentication mechanism between the client and the server. Again out of scope for this library except exchanging the auth data. You can tweak the example to have echo messages exchange auth data. It's easy to manage sessions in memory because a socket exists with your app in memory.

zemuldo commented 4 years ago

Closing this issue because of no activity.

zemuldo commented 4 years ago

If there is something you still need, you can reopen or create a new one 😄