Comments (4)
Don't add the first slash to the option
from socket.io-client-swift.
It should never get to the engine prepended with a slash. Unless you do something stupid like ["nsp": "//chat"]
In which case I'd say your code is broken.
https://github.com/socketio/socket.io-client-swift/blob/master/SwiftIO/SocketIOClient.swift#L107
from socket.io-client-swift.
we should use var opts = ["nsp": "/chat"]
or else the socket.io server will give no socket for namespace undefined
Client.prototype.ondecoded = function(packet) {
if (parser.CONNECT == packet.type) {
this.connect(packet.nsp);
} else {
var socket = this.nsps[packet.nsp];
if (socket) {
socket.onpacket(packet);
} else {
debug('no socket for namespace %s', packet.nsp);
}
}
};
ps: I have updated the latest repo code.
from socket.io-client-swift.
Now I know why.
I have sent the wrong args in emit and the server parser error
in client
self.socket.emit("authentication", "{\"token\":\"\(token)\"}")
in server
// socket.io-parser
// index.js
function decodeString(str) {
...
// look up json data
if (str.charAt(++i)) {
try {
var a = str.substr(i)
p.data = json.parse(a);
} catch(e){
return error();
}
}
...
}
from socket.io-client-swift.
Related Issues (20)
- How to Read ByteAarray Data received my Socket IO
- getting compilaton error
- Socket.IO-Client-Swift version 16 Crash on iOS 16, built with Xcode 15 HOT 6
- Does the library support socks proxy?
- Reconnect Auth Behavior
- socket.emitWithAck(...)timingOut(...) timeout callback never called HOT 2
- LOG SocketManager: Tried connecting an already active socket
- Cannot connect to server, when android client can connect HOT 3
- Privacy Manifest HOT 3
- Potential Memory Management Issue with emitWithAck and timingOut(after:) HOT 1
- How can i use SocketIO without Rosetta on Apple Silicon
- Compiling for iOS 10.0, but module 'Starscream' has a minimum deployment target of iOS 12.0 HOT 1
- Socket didn't send or get any Ping Pong Events HOT 4
- Implement Connection State Recovery
- Starscream version (4.0.8) HOT 3
- Socket not connecting HOT 5
- Volatile events
- Compiling for iOS 11.0, but module 'Starscream' has a minimum deployment target of iOS 12.0 HOT 2
- Keep listening socket when user enters background HOT 2
- Compiling for iOS 11.0, but module 'Starscream' has a minimum deployment target of iOS 12.0 HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from socket.io-client-swift.