Commit Graph

31 Commits

Author SHA1 Message Date
Guillermo Rauch
7489fa4378 Added parseUri to util, cleaned up. 2011-11-27 11:30:28 -08:00
Guillermo Rauch
edc76f322a Added transport name to websocket 2011-11-27 11:30:12 -08:00
Guillermo Rauch
4c0e69e458 To close polling transports, we must write a message. 2011-11-27 11:29:43 -08:00
Guillermo Rauch
8dd5a6dbab Also make sure close is triggered. 2011-11-27 11:29:16 -08:00
Guillermo Rauch
2bb5d0b00d Do peaking of messages in polling transport:
- if the transport readyState is `opening`, expect a PONG packet
- if we get close, abort ongoing requests
2011-11-27 11:28:03 -08:00
Guillermo Rauch
bff32b2463 Write a ping packet after opening polling. 2011-11-27 11:27:51 -08:00
Guillermo Rauch
889797db90 Style cleanup 2011-11-27 11:27:41 -08:00
Guillermo Rauch
60e8782dac Added name to polling XHR, cleaned up. 2011-11-27 11:27:20 -08:00
Guillermo Rauch
d1d691fdff Added jsonp transport name 2011-11-27 11:27:07 -08:00
Guillermo Rauch
9ad1f7f158 Simplified script loader. 2011-11-27 11:26:52 -08:00
Guillermo Rauch
1286e41301 Fixed last commit 2011-11-27 11:26:27 -08:00
Guillermo Rauch
6360ebd3cc Proxy web-socket-js debugging to our own 2011-11-27 11:25:33 -08:00
Guillermo Rauch
73263b98bc Added transport name to proto. 2011-11-27 11:25:22 -08:00
Guillermo Rauch
5a2580ec7f Added reusable noop 2011-11-27 11:25:15 -08:00
Guillermo Rauch
6c0a714641 Removed data event and do parsing in transport.
Unfortunately, it makes our API less clean to depend on specific
parsing done by the Transport when clearly it doesnt belong there.

The problem is that XHR polling *needs* specific messages to compensate
for lack of features such as the ability to signal a connection close.

Since we're already doing peaking of message types in the polling transport,
we want to avoid the performance penalty of double parsing at the polling
level and later at the Engine level, and we sacrifice a little bit of
API purity.
2011-11-27 11:23:47 -08:00
Guillermo Rauch
64f371477b Improved error message 2011-11-27 10:38:17 -08:00
Guillermo Rauch
5435b043ff Make sure Transport#error emits a transport error 2011-11-27 10:37:54 -08:00
Guillermo Rauch
f77420c317 Gave up, we need an Engine reference from transport. 2011-11-27 10:34:16 -08:00
Guillermo Rauch
bd0601a66e Improved message types
- heartbeat is now a ping/pong
- probing is now a ping/pong
2011-11-27 10:29:46 -08:00
Guillermo Rauch
bd04f2771a Added WebSocket API compatibility to EventEmitter. 2011-11-27 10:29:30 -08:00
Guillermo Rauch
ecb288598e Added onclose handler. 2011-11-27 10:29:08 -08:00
Guillermo Rauch
d9f8fa494f Improved close. 2011-11-27 10:28:59 -08:00
Guillermo Rauch
60a52e209d Abstracted buffer flushing logic into its own fn. 2011-11-27 10:28:20 -08:00
Guillermo Rauch
c00744c78f Added onMessage handlers. 2011-11-27 10:28:06 -08:00
Guillermo Rauch
fc9d9f25c5 Handle onopen property manually. 2011-11-27 10:23:47 -08:00
Guillermo Rauch
0b27f85758 Simplified setTransport. 2011-11-27 10:23:31 -08:00
Guillermo Rauch
153d59aa21 Simplified init mechanism. 2011-11-27 10:23:14 -08:00
Guillermo Rauch
0ae7803900 Added createTransport method. 2011-11-27 10:22:50 -08:00
Guillermo Rauch
e96e0252ff Handle ws/ws URIs. 2011-11-27 10:22:19 -08:00
Guillermo Rauch
f5aacb7347 Expose utils locally. 2011-11-27 10:21:55 -08:00
Guillermo Rauch
21b75fa15e Initial import 2011-11-18 10:08:39 -08:00