已声明带有选项的套接字。获取语法错误类型的表达式是不明确的,没有更多的上下文。使用swift 2.2。我完全被困了
let socket = SocketIOClient(socketURL: "https://localhost:8080", opts: [
"reconnects": true,
"reconnectAttempts": 5,
"reconnectWait": 5,
"nsp": "swift",
"forcePolling": true,
"cookies": nil
])
修改
var socket = SocketIOClient(socketURL: NSURL(string:
"http://XX.XXX.XXX.XXX:XXXX")!,
config:["forceNew": true,
"reconnectAttempts": 100,
"timeout": 10000,
"transports": ["websocket"] ])
我已关注this链接