class SOCKS::Enhanced::WebSocket

Defined in:

socks/enhanced/websocket.cr

Constructors

Instance Method Summary

Class methods inherited from class IO

yield_copy(src : IO, dst : IO, &block : Int64, Int32 -> ) : Int64 yield_copy

Constructor Detail

def self.new(io : HTTP::WebSocket::Protocol, options : Options | Nil = nil, state : State::WebSocket = State::WebSocket.new) #

[View source]

Instance Method Detail

def allow_connection_pause? : Bool #

[View source]
def allow_connection_reuse? : Bool #

[View source]
def close #
Description copied from class IO

Closes this IO.

IO defines this is a no-op method, but including types may override.


[View source]
def closed? #
Description copied from class IO

Returns true if this IO is closed.

IO defines returns false, but including types may override.


[View source]
def connection_identifier #

[View source]
def final_command_flag? : CommandFlag | Nil #

[View source]
def flush #
Description copied from class IO

Flushes buffered data, if any.

IO defines this is a no-op method, but including types may override.


[View source]
def io : HTTP::WebSocket::Protocol #

[View source]
def local_address : Socket::Address | Nil #

[View source]
def notify_peer_incoming #

[View source]
def notify_peer_negotiate(command_flag : CommandFlag) #

[View source]
def options : Options | Nil #

[View source]
def ping(slice : Bytes | Nil) #

[View source]
def pong(slice : Bytes | Nil) #

[View source]
def process_client_side_connection_pause_pending! : State::QueueFlag #

[View source]
def process_negotiate(source : IO) #

[View source]
def process_response_pending_command_negotiate #

[View source]
def process_server_side_connection_pause_pending!(connection_identifier : UUID, pause_pool : PausePool) : PausePool::Entry | Nil #

[View source]
def read(slice : Bytes) : Int32 #
Description copied from class IO

Reads at most slice.size bytes from this IO into slice. Returns the number of bytes read, which is 0 if and only if there is no more data to read (so checking for 0 is the way to detect end of file).

io = IO::Memory.new "hello"
slice = Bytes.new(4)
io.read(slice) # => 4
slice          # => Bytes[104, 101, 108, 108]
io.read(slice) # => 1
slice          # => Bytes[111, 101, 108, 108]
io.read(slice) # => 0

[View source]
def read_timeout #

[View source]
def read_timeout=(value : Int | Time::Span | Nil) #

[View source]
def received_command? : Tuple(Int64, CommandFlag) | Nil #

[View source]
def received_command_flag? : CommandFlag | Nil #

[View source]
def remote_address : Socket::Address | Nil #

[View source]
def reset_settings(command_flag : CommandFlag | Nil) : Bool #

[View source]
def resynchronize #

[View source]
def send_command? : Tuple(Int64, CommandFlag) | Nil #

[View source]
def send_command_flag? : CommandFlag | Nil #

[View source]
def state : State::WebSocket #

[View source]
def state=(state : State::WebSocket) #

[View source]
def synchronize(synchronize_flag : State::SynchronizeFlag, ignore_incoming_alert : Bool = true) #

[View source]
def synchronizing=(value : Bool) #

[View source]
def synchronizing? : Bool #

[View source]
def transporting=(value : Bool) #

[View source]
def transporting? : Bool #

[View source]
def update_receive_rescue_buffer(slice : Bytes) : Bool #

[View source]
def write(slice : Bytes) : Nil #
Description copied from class IO

Writes the contents of slice into this IO.

io = IO::Memory.new
slice = Bytes.new(4) { |i| ('a'.ord + i).to_u8 }
io.write(slice)
io.to_s # => "abcd"

[View source]
def write_timeout #

[View source]
def write_timeout=(value : Int | Time::Span | Nil) #

[View source]