SocketSwiftSample icon indicating copy to clipboard operation
SocketSwiftSample copied to clipboard

how to check if connected with server or not ?

Open knight6700 opened this issue 6 years ago • 7 comments

knight6700 avatar Jun 17 '19 10:06 knight6700

Hi,

You can track the connection status in

func stream(_ aStream: Stream, handle eventCode: Stream.Event)

If you want to check in between, then you can add a bool property in SocketDataManager and toggle it based on a stream in closed or not.

anoop4real avatar Jun 17 '19 10:06 anoop4real

i want this return Bool to check it in updateLocation

knight6700 avatar Jun 17 '19 18:06 knight6700

Hello, Can you provide some more information on what you are trying to achieve?

anoop4real avatar Jun 23 '19 11:06 anoop4real

hello, I send location when app close and if the internet connection down and connect again the connection with socket refuse must connect again I want to check if not connected or connected

knight6700 avatar Jun 24 '19 09:06 knight6700

Just define a bool in SocketDataManager and make SocketDataManageras singleton so that you can access it from anywhere and check its data. Update the bool in every event.

anoop4real avatar Jun 24 '19 14:06 anoop4real

Hello, i am Not able to get any message from PacketSender. every time the packet sender state disconnecting.

gyana-techy-ios avatar Mar 03 '20 10:03 gyana-techy-ios

@gyanoroprise Packet sender has a quick time out, so please make sure the Persistent TCP box is checked.... check the picture in the ReadMe

anoop4real avatar Mar 03 '20 12:03 anoop4real