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

Trouble with express #16

Closed
Tarang opened this issue Apr 7, 2013 · 1 comment
Closed

Trouble with express #16

Tarang opened this issue Apr 7, 2013 · 1 comment

Comments

@Tarang
Copy link
Member

Tarang commented Apr 7, 2013

I'm getting an error with express:

http.js:673
    throw new Error('Can\'t set headers after they are sent.');
          ^
Error: Can't set headers after they are sent.
    at ServerResponse.OutgoingMessage.setHeader (http.js:673:11)
    at ServerResponse.res.setHeader (/root/test_client/node_modules/express/node_modules/connect/lib/patch.js:59:22)
    at ServerResponse.res.set.res.header (/root/test_client/node_modules/express/lib/response.js:518:10)
    at ServerResponse.res.send (/root/test_client/node_modules/express/lib/response.js:124:10)
    at exports.ddptest (/root/test_client/routes/test.js:1059:25)
    at DDPClient._message (/root/test_client/routes/test.js:116:7)
    at WebSocket.DDPClient._prepareHandlers (/root/test_client/routes/test.js:78:10)
    at WebSocket.EventEmitter.emit (events.js:99:17)
    at Receiver.self._receiver.ontext (/root/test_client/node_modules/ws/lib/WebSocket.js:544:10)
    at Receiver.opcodes.1.finish (/root/test_client/node_modules/ws/lib/Receiver.js:397:14)

Previously I used the ddp client but had to use a custom iteration when pre1 was released. The error is usually caused by some kind of inifinite loop

Using a custom express route:

var client = new DDPClient({
  host: "localhost",
  port: 3000
});

client.connect(function () {
  client.call("ddp_test", ["value"], function (err, result) {
    console.log(result);
    client.close();
  })
});
@Tarang
Copy link
Member Author

Tarang commented Apr 8, 2013

#17 Fixes this

@Tarang Tarang closed this as completed Apr 8, 2013
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

1 participant