nuclearace / Socket.IO-Client-Swift

socket.io-client for Swift
Other
361 stars 53 forks source link

Socket not connected in client but in server Connect #158

Closed mostafatabal closed 6 years ago

mostafatabal commented 6 years ago

@nuclearace

this my log , i try torrent socket connected from my code but it not success :-

i don't why

i see this first LOG SocketManager: Tried connecting socket when engine isn't open. Connecting

and i see after :- LOG SocketEngine: Engine is being released

but not print socket connected

NSURL* url = [[NSURL alloc] initWithString:@"http://localhost:4200"];
    SocketManager* manager = [[SocketManager alloc] initWithSocketURL:url config:@{@"log": @YES,@"forcePolling":@YES}];
    SocketIOClient* socket = manager.defaultSocket;

    [socket on:@"connect" callback:^(NSArray* data, SocketAckEmitter* ack) {
        NSLog(@"socket connected");
    }];

    [socket connect];
2018-01-20 12:25:25.464746+0300 socketIo[638:5854432] LOG SocketIOClient{/}: Adding handler for event: connect
2018-01-20 12:25:28.193216+0300 socketIo[638:5854432] LOG SocketIOClient{/}: Handling event: statusChange with data: [connecting]
2018-01-20 12:25:28.193424+0300 socketIo[638:5854432] LOG SocketManager: Tried connecting socket when engine isn't open. Connecting
2018-01-20 12:25:28.193536+0300 socketIo[638:5854432] LOG SocketManager: Adding engine
2018-01-20 12:25:29.650973+0300 socketIo[638:5854432] LOG SocketManager: Manager is being released
2018-01-20 12:25:29.650973+0300 socketIo[638:5854546] LOG SocketEngine: Starting engine. Server: http://localhost:4200
2018-01-20 12:25:29.651136+0300 socketIo[638:5854546] LOG SocketEngine: Handshaking
2018-01-20 12:25:29.654442+0300 socketIo[638:5854432] LOG SocketIOClient{/}: Client is being released
2018-01-20 12:25:29.763625+0300 socketIo[638:5854546] LOG SocketEnginePolling: Doing polling GET http://localhost:4200/socket.io/?transport=polling&b64=1
2018-01-20 12:25:29.851153+0300 socketIo[638:5854546] LOG SocketEnginePolling: Got polling response
2018-01-20 12:25:29.881272+0300 socketIo[638:5854546] LOG SocketEnginePolling: Got poll message: 97:0{"sid":"HyWsjPf7hQJ_ZdWXAAAB","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":60000}2:40
2018-01-20 12:25:29.956512+0300 socketIo[638:5854546] LOG SocketEngine: Got message: 0{"sid":"HyWsjPf7hQJ_ZdWXAAAB","upgrades":["websocket"],"pingInterval":25000,"pingTimeout":60000}
2018-01-20 12:25:30.007747+0300 socketIo[638:5854546] LOG SocketEngine: Got message: 40
2018-01-20 12:25:30.008148+0300 socketIo[638:5854546] LOG SocketEngine: Writing poll:  has data: false
2018-01-20 12:25:30.008374+0300 socketIo[638:5854546] LOG SocketEnginePolling: Sending poll:  as type: 2
2018-01-20 12:25:30.020470+0300 socketIo[638:5854546] LOG SocketEnginePolling: Created POST string: 1:2
2018-01-20 12:25:30.021738+0300 socketIo[638:5854546] LOG SocketEnginePolling: POSTing
2018-01-20 12:25:30.021918+0300 socketIo[638:5854546] LOG SocketEngine: Engine is being released
nuclearace commented 6 years ago

@mostafatabal Stop opening the same issue multiple times. Just use one.

mostafatabal commented 6 years ago

@nuclearace okay ,i'm sorry what is error in my issue , please help