forked from igrigorik/em-websocket
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
35 changed files
with
1,104 additions
and
349 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module EventMachine | ||
module WebSocket | ||
module Close03 | ||
def close_websocket(code, body) | ||
# TODO: Ideally send body data and check that it matches in ack | ||
send_frame(:close, '') | ||
@state = :closing | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
module EventMachine | ||
module WebSocket | ||
module Close05 | ||
def close_websocket(code, body) | ||
# TODO: Ideally send body data and check that it matches in ack | ||
send_frame(:close, "\x53") | ||
@state = :closing | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
module EventMachine | ||
module WebSocket | ||
module Close06 | ||
def close_websocket(code, body) | ||
if code | ||
close_data = [code].pack('n') | ||
close_data << body if body | ||
send_frame(:close, close_data) | ||
else | ||
send_frame(:close, '') | ||
end | ||
@state = :closing | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
module EventMachine | ||
module WebSocket | ||
module Close75 | ||
def close_websocket(code, body) | ||
@state = :closed | ||
@connection.close_connection_after_writing | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# encoding: BINARY | ||
|
||
module EventMachine | ||
module WebSocket | ||
# The only difference between draft 03 framing and draft 04 framing is | ||
# that the MORE bit has been changed to a FIN bit | ||
module Framing04 | ||
include Framing03 | ||
|
||
private | ||
|
||
def fin; true; end | ||
end | ||
end | ||
end |
Oops, something went wrong.