class SCTPBaseSocket

Direct Known Subclasses

Defined in:

sctp/sctp_base_socket.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(family : Socket::Family, type : Socket::Type) #

[View source]
def self.new(fd : Int32, type : Socket::Type) #

[View source]

Instance Method Detail

def address(host, port, family = Socket::Family::INET6) #

[View source]
def addressv4(host, port) #

[View source]
def addressv6(host, port) #

[View source]
def autoclose=(seconds : Int32 | Nil) #

[View source]
def bind(host, port, type : Socket::Type, dns_timeout = nil, &) #

[View source]
def listen(backlog = 128) #

[View source]
def on_message(stream_no : UInt16 | Int32, source : IPAddress, &callback : SCTPMessage -> ) #

[View source]
def on_message(source : IPAddress, &callback : SCTPMessage -> ) #

[View source]
def on_message(stream_no : UInt16 | Int32, &callback : SCTPMessage -> ) #

[View source]
def on_message(&on_message : SCTPMessage -> ) #

[View source]
def on_message(stream_no : UInt16 | Int32, source : IPAddress, none : Nil) #

[View source]
def on_message(source : IPAddress, none : Nil) #

[View source]
def on_message(stream_no : UInt16 | Int32, none : Nil) #

[View source]
def process #

[View source]
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)

[View source]
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

[View source]
def send(slice : Slice(UInt8), stream_no : UInt16, to : IPAddress) : Int32 #

[View source]
def send(data, stream_no : Int32 | UInt16, to : IPAddress) : Int32 #

[View source]
def set_socketopt(option : Int32, value) #

[View source]