@@ -62,7 +62,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
62
62
return self . _connecting
63
63
}
64
64
public var cookies : [ NSHTTPCookie ] ?
65
- public var engine : SocketEngine !
65
+ public var engine : SocketEngine ?
66
66
public var nsp = " / "
67
67
public var reconnects = true
68
68
public var reconnecting : Bool {
@@ -170,7 +170,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
170
170
self . _connecting = false
171
171
self . _connected = false
172
172
self . _reconnecting = false
173
- self . engine. close ( fast: fast)
173
+ self . engine? . close ( fast: fast)
174
174
}
175
175
176
176
/**
@@ -187,7 +187,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
187
187
}
188
188
189
189
self . addEngine ( )
190
- self . engine. open ( )
190
+ self . engine? . open ( )
191
191
}
192
192
193
193
/**
@@ -207,7 +207,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
207
207
self . paramConnect = true
208
208
209
209
self . addEngine ( )
210
- self . engine. open ( opts: params)
210
+ self . engine? . open ( opts: params)
211
211
}
212
212
213
213
private func createOnAck( event: String , items: [ AnyObject ] ) -> OnAckCallback {
@@ -242,7 +242,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
242
242
self . currentReconnectAttempt = 0
243
243
self . reconnectTimer? . invalidate ( )
244
244
self . reconnectTimer = nil
245
- self . _sid = self . engine. sid
245
+ self . _sid = self . engine? . sid
246
246
247
247
// Don't handle as internal because something crazy could happen where
248
248
// we disconnect before it's handled
@@ -327,9 +327,9 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
327
327
SocketLogger . log ( " Emitting: \( str) " , client: self )
328
328
329
329
if packet. type == SocketPacket . PacketType. BINARY_EVENT {
330
- self . engine. send ( str, withData: packet. binary)
330
+ self . engine? . send ( str, withData: packet. binary)
331
331
} else {
332
- self . engine. send ( str, withData: nil )
332
+ self . engine? . send ( str, withData: nil )
333
333
}
334
334
}
335
335
@@ -349,9 +349,9 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
349
349
SocketLogger . log ( " Emitting Ack: \( str) " , client: self !)
350
350
351
351
if packet. type == SocketPacket . PacketType. BINARY_ACK {
352
- self ? . engine. send ( str, withData: packet. binary)
352
+ self ? . engine? . send ( str, withData: packet. binary)
353
353
} else {
354
- self ? . engine. send ( str, withData: nil )
354
+ self ? . engine? . send ( str, withData: nil )
355
355
}
356
356
}
357
357
}
@@ -413,7 +413,7 @@ public final class SocketIOClient: NSObject, SocketEngineClient, SocketLogClient
413
413
SocketLogger . log ( " Joining namespace " , client: self )
414
414
415
415
if self . nsp != " / " {
416
- self . engine. send ( " 0/ \( self . nsp) " , withData: nil )
416
+ self . engine? . send ( " 0/ \( self . nsp) " , withData: nil )
417
417
}
418
418
}
419
419
0 commit comments