Skip to content

Instantly share code, notes, and snippets.

@dfalmeida
Last active March 9, 2018 16:17
Show Gist options
  • Save dfalmeida/f0fdb155d9389f2b5209815652536939 to your computer and use it in GitHub Desktop.
Save dfalmeida/f0fdb155d9389f2b5209815652536939 to your computer and use it in GitHub Desktop.
func connectSocket() {
WebSocket.instance.setup(with: "http://192.168.1.146:4000/socket/websocket")
WebSocket.instance.connect(with: {[weak self] in
guard
let weakSelf = self
else { return }
WebSocket.instance.joinChannel(with: "game:slimeSoccer",
payload: ["email":"[email protected]"],
channelEventListeners: weakSelf.channelListeners(),
onJoinSuccess: { (payload) in },
onJoinError: { (payload) in })
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment