{"action":"closed","issue":{"url":"https://api.github.com/repos/shuoli84/SocketIOCocoa/issues/22","labels_url":"https://api.github.com/repos/shuoli84/SocketIOCocoa/issues/22/labels{/name}","comments_url":"https://api.github.com/repos/shuoli84/SocketIOCocoa/issues/22/comments","events_url":"https://api.github.com/repos/shuoli84/SocketIOCocoa/issues/22/events","html_url":"https://github.com/shuoli84/SocketIOCocoa/issues/22","id":59346576,"number":22,"title":"Double connection","user":{"login":"ZloyDyadka","id":5509643,"avatar_url":"https://avatars.githubusercontent.com/u/5509643?v=3","gravatar_id":"","url":"https://api.github.com/users/ZloyDyadka","html_url":"https://github.com/ZloyDyadka","followers_url":"https://api.github.com/users/ZloyDyadka/followers","following_url":"https://api.github.com/users/ZloyDyadka/following{/other_user}","gists_url":"https://api.github.com/users/ZloyDyadka/gists{/gist_id}","starred_url":"https://api.github.com/users/ZloyDyadka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ZloyDyadka/subscriptions","organizations_url":"https://api.github.com/users/ZloyDyadka/orgs","repos_url":"https://api.github.com/users/ZloyDyadka/repos","events_url":"https://api.github.com/users/ZloyDyadka/events{/privacy}","received_events_url":"https://api.github.com/users/ZloyDyadka/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-28T16:04:55Z","updated_at":"2015-03-03T14:19:19Z","closed_at":"2015-03-03T14:19:19Z","body":"When I try to connect to my server via SocketIOClient I’m getting two connections and then when I’m trying to send something, my emit duplicates.\r\nFirst of all I open a client and then I open a socket delegated to client\r\ncode example:\r\n```\r\nprivate struct kSocketHandler\r\n{\r\n    var socket: SocketIOSocket\r\n    var handlers: NSMutableArray\r\n    // events\r\n    var eventSheet: kSocketEventSheet?\r\n    \r\n    init(Socket s: SocketIOSocket)\r\n    {\r\n        socket = s\r\n        handlers = NSMutableArray()\r\n    }\r\n\r\n    ....\r\n\r\n}\r\n\r\n....\r\n\r\ninternal class kSocketManager: SocketIOClientDelegate, SocketIOSocketDelegate\r\n\r\n....\r\n\r\nvar client: SocketIOClient\r\n    \r\nprivate var sockets: [kSocketHandler]\r\n\r\n....\r\n\r\n// initilization\r\nclient = SocketIOClient(uri: u, transports: [\"websocket\"], autoConnect: false, reconnect: false, reconnectAttempts: 0, reconnectDelay: 5, reconnectDelayMax: 10, timeout: 7)\r\nclient.delegate = self\r\n\r\n....\r\n\r\n// initialization of the socket (with a small wrapper)\r\nvar newSocket = kSocketHandler(Socket: self.client.socket(namespace))\r\n            \r\nnewSocket.socket.delegate = self\r\nnewSocket.eventSheet = socketEventSheet\r\nnewSocket.socket.open()\r\n            \r\nself.sockets.append(newSocket)\r\n```\r\nSo, I receive «OnSocketOpen» event twice every time i try to run this code.\r\n\r\nAny suggestions?\r\nSincerely yours.\r\n\r\n![d connection](https://cloud.githubusercontent.com/assets/5509643/6426744/1dd55a02-bf83-11e4-867c-9db9e86922e4.png)"}}