Scarlet
Scarlet copied to clipboard
Are @Send methods blocking and can they return a confirmation whether a send action was successful?
I tried looking through documentation but can't find any clear answer.
I need to know whether @Send methods are blocking, and is there any way to get a confirmation if send action was successful, so I can potentially implement a backup API call in case socket fails..
Thanks.
I don't think that this can be implemented in sockets functionality. Socket is just a pipe that you either throw stuff in or get stuff from it. There is not a callback for each send. I guess you have to implement some request/response actions in your API.
This is what I know. But I would like to hear if anybody knows more about it!
It could at least return false
if connection is disconnected/destroyed
No...thats not the way Sockets work. Socket is just an open bi-directional "road" between two end points and they can send data packets one to another. The only way to know the status of the connection is the PingPong method.
@james04gr i did not claim otherwise. It can return false in disconnected/destroyed
case because Scarlet has connection state internally
@james04gr i did not claim otherwise. It can return false in
disconnected/destroyed
case because Scarlet has connection state internally
Oh ok....i thought u spoke generally!
@james04gr i did not claim otherwise. It can return false in
disconnected/destroyed
case because Scarlet has connection state internally
I think that's already the case, just make the @send function return a boolean and you'll get false if the connection is disconnected.