class SCTPBaseSocket
- SCTPBaseSocket
- IPSocket
- Socket
- IO
- Reference
- Object
Direct Known Subclasses
Defined in:
sctp/sctp_base_socket.crConstructors
Instance Method Summary
- #address(host, port, family = Socket::Family::INET6)
- #addressv4(host, port)
- #addressv6(host, port)
- #autoclose=(seconds : Int32 | Nil)
- #bind(host, port, type : Socket::Type, dns_timeout = nil, &)
- #listen(backlog = 128)
- #on_message(stream_no : UInt16 | Int32, source : IPAddress, &callback : SCTPMessage -> )
- #on_message(source : IPAddress, &callback : SCTPMessage -> )
- #on_message(stream_no : UInt16 | Int32, &callback : SCTPMessage -> )
- #on_message(&on_message : SCTPMessage -> )
- #on_message(stream_no : UInt16 | Int32, source : IPAddress, none : Nil)
- #on_message(source : IPAddress, none : Nil)
- #on_message(stream_no : UInt16 | Int32, none : Nil)
- #process
-
#receive(slice : Slice(UInt8)) : Tuple(Int32, UInt16, IPAddress)
Receives a binary message from the previously bound address.
-
#receive : SCTPMessage
Receives a text message from the previously bound address.
- #send(slice : Slice(UInt8), stream_no : UInt16, to : IPAddress) : Int32
- #send(data, stream_no : Int32 | UInt16, to : IPAddress) : Int32
- #set_socketopt(option : Int32, value)
Constructor Detail
Instance Method Detail
def on_message(stream_no : UInt16 | Int32, source : IPAddress, &callback : SCTPMessage -> )
#
def receive(slice : Slice(UInt8)) : Tuple(Int32, UInt16, IPAddress)
#
Description copied from class Socket
Receives a binary message from the previously bound address.
require "socket"
server = Socket.udp(Socket::Family::INET)
server.bind("localhost", 1234)
message = Bytes.new(32)
bytes_read, client_addr = server.receive(message)
def receive : SCTPMessage
#
Description copied from class Socket
Receives a text message from the previously bound address.
require "socket"
server = Socket.udp(Socket::Family::INET)
server.bind("localhost", 1234)
message, client_addr = server.receive