-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extract system-specifics from Socket (#10706)
- Loading branch information
1 parent
9cb47a7
commit a2c632e
Showing
8 changed files
with
491 additions
and
265 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
module Crystal::System::Socket | ||
# Creates a file descriptor / socket handle | ||
# private def create_handle(family, type, protocol, blocking) : Handle | ||
|
||
# Initializes a file descriptor / socket handle for use with Crystal Socket | ||
# private def initialize_handle(fd) | ||
|
||
# private def system_connect(addr, timeout = nil) | ||
|
||
# Tries to bind the socket to a local address. | ||
# Yields an `Socket::BindError` if the binding failed. | ||
# private def system_bind(addr, addrstr) | ||
|
||
# private def system_listen(backlog) | ||
|
||
# private def system_accept | ||
|
||
# private def system_send(bytes : Bytes) : Int32 | ||
|
||
# private def system_send_to(bytes : Bytes, addr : ::Socket::Address) | ||
|
||
# private def system_receive(bytes) | ||
|
||
# private def system_close_read | ||
|
||
# private def system_close_write | ||
|
||
# private def system_reuse_port? | ||
|
||
# private def system_reuse_port=(val : Bool) | ||
|
||
# private def system_linger | ||
|
||
# private def system_linger=(val) | ||
|
||
# private def system_getsockopt(fd, optname, optval, level = LibC::SOL_SOCKET) | ||
|
||
# private def system_setsockopt(fd, optname, optval, level = LibC::SOL_SOCKET) | ||
|
||
# private def system_blocking? | ||
|
||
# private def system_blocking=(value) | ||
|
||
# private def system_tty? | ||
|
||
# private def system_close_on_exec? | ||
|
||
# private def system_close_on_exec=(arg : Bool) | ||
|
||
# def self.fcntl(fd, cmd, arg = 0) | ||
|
||
# private def unbuffered_read(slice : Bytes) | ||
|
||
# private def unbuffered_write(slice : Bytes) | ||
|
||
# private def system_close | ||
|
||
# IPSocket: | ||
|
||
# private def system_local_address | ||
|
||
# private def system_remote_address | ||
|
||
# TCPSocket: | ||
|
||
# private def system_tcp_keepalive_idle | ||
|
||
# private def system_tcp_keepalive_idle=(val : Int) | ||
|
||
# private def system_tcp_keepalive_interval | ||
|
||
# private def system_tcp_keepalive_interval=(val : Int) | ||
|
||
# private def system_tcp_keepalive_count | ||
|
||
# private def system_tcp_keepalive_count=(val : Int) | ||
end | ||
|
||
{% if flag?(:unix) %} | ||
require "./unix/socket" | ||
{% else %} | ||
{% raise "No Crystal::System::Socket implementation available" %} | ||
{% end %} |
Oops, something went wrong.