'iOS SwiftyZeroMQ get status

I am using SwiftyZeroMQ in iOS for zeromq. I can connect and communicate via sockets. But issue is I can't find anyway to know how can I get event/status that socket connection has failed?

like let result = zmq_connect(handle, endpoint) always return 0 in result



Solution 1:[1]

…how can I get event/status that socket connection has failed?

The first step is to forget everything about native-sockets, as ZeroMQ Socket()-instances are different.

To start understanding the concept, perhaps start here to get the global view of the composition of:

  • what is the Scalable Formal Communications (behavioural pattern) Archetype
  • what is the engine - the actual signalling/messaging serving Context()
  • what is the AccessPoint (to be .bind()-exposed to public and so .connect()-ed as & when needed)

Having got these abstractions, one soon realises the real-world applications seldom rely on just one pattern, most often there are many, app-level cooperating (possibly also in many-to-many topologies) connections, like noted here

Last, but not least, there are low-level details we may source from our abstracted Scalable Formal Communication Archetypes' AccessPoints, if using a ZeroMQ API documented socket_monitor() and set it up so as to feed many low-level events we normally do not want to see in production. ZeroMQ API documentation is instrumental in how to do this, yet your iOS-specific native-API binding may, yet need not, cover this in your current language-binding, so start first with the SwiftyZeroMQ documentation, if it covers also this ZeroMQ native-API functions.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1