Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using UNIX domain socket #43

Closed
swmoon203 opened this issue Nov 22, 2014 · 6 comments
Closed

Problem using UNIX domain socket #43

swmoon203 opened this issue Nov 22, 2014 · 6 comments

Comments

@swmoon203
Copy link

it fails on decoding message

var args = msgpack.decode(msg);

events.js:72
throw er; // Unhandled 'error' event
^
SyntaxError: Unexpected token �
at Object.parse (native)

swmoon203 added a commit to swmoon203/socket.io-emitter that referenced this issue Nov 22, 2014
swmoon203 added a commit to swmoon203/socket.io-redis that referenced this issue Nov 22, 2014
@nkzawa
Copy link
Contributor

nkzawa commented Nov 23, 2014

How can I reproduce this? Could you explain the point of your PRs?

@swmoon203
Copy link
Author

I ran Redis under unix domain socket

Emitter

var ioe = socketid_emitter({ socket: '/var/run/shm/redis.sock' });
ioe.of("/news").emit("update", message);

Reciver

var server = http.Server(app);
var io = socketio(server);
io.adapter(socketio_redis({ socket: '/var/run/shm/redis.sock' }));

Error log

events.js:72
        throw er; // Unhandled 'error' event
                 throw er; // Unhandled 'error' event
                   ^^

Error: 107 trailing bytes
    at Object.decode (/node_modules/socket.io-redis/node_modules/msgpack-js/msgpack.js:200:47)
    at Redis.onmessage (/node_modules/socket.io-redis/index.js:93:24)
    at RedisClient.EventEmitter.emit (events.js:117:20)
    at RedisClient.return_reply (/node_modules/socket.io-redis/node_modules/redis/index.js:672:22)
    at ReplyParser.<anonymous> (/node_modules/socket.io-redis/node_modules/redis/index.js:309:14)
    at ReplyParser.EventEmitter.emit (events.js:95:17)
    at ReplyParser.send_reply (/node_modules/socket.io-redis/node_modules/redis/lib/parser/javascript.js:300:10)
    at ReplyParser.execute (/node_modules/socket.io-redis/node_modules/redis/lib/parser/javascript.js:211:22)
    at RedisClient.on_data (/node_modules/socket.io-redis/node_modules/redis/index.js:534:27)
    at Socket.<anonymous> (/node_modules/socket.io-redis/node_modules/redis/index.js:91:14)

@goalsoft
Copy link

Hello, I found that if you use unix socket, will cause an error, it will not use tcp socket

@rauchg
Copy link
Contributor

rauchg commented Feb 14, 2015

I removed the socket option, it made no sense

@rauchg rauchg closed this as completed Feb 14, 2015
@goalsoft
Copy link

goalsoft commented Mar 5, 2015

How would not make sense? Unix socket with faster

@rauchg
Copy link
Contributor

rauchg commented Apr 5, 2015

Because in any case it should be two sockets, considering we need to open connections to Redis.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants