Synchronously begins a session, executes the given block, and ends the session.
- macOS 10.12+
On return, if an error occurred when attempting to create a session or execute the block, contains details about the error.
A block to be called in the context of the created session. This block returns a Boolean value indicating whether communication was successful.
To indicate that an error occurred during the session, populate this with an
NSErrorobject containing details and return