Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change protocol socket fd to Socket::Handle #10772

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/socket/tcp_server.cr
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class TCPServer < TCPSocket
end

# Creates a TCPServer from an already configured raw file descriptor
def initialize(*, fd : Int32, family : Family = Family::INET)
def initialize(*, fd : Handle, family : Family = Family::INET)
super(fd: fd, family: family)
end

Expand Down
4 changes: 2 additions & 2 deletions src/socket/tcp_socket.cr
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class TCPSocket < IPSocket
super family, type, protocol
end

protected def initialize(fd : Int32, family : Family, type : Type, protocol : Protocol)
protected def initialize(fd : Handle, family : Family, type : Type, protocol : Protocol)
super fd, family, type, protocol
end

# Creates a TCPSocket from an already configured raw file descriptor
def initialize(*, fd : Int32, family : Family = Family::INET)
def initialize(*, fd : Handle, family : Family = Family::INET)
super fd, family, Type::STREAM, Protocol::TCP
end

Expand Down
2 changes: 1 addition & 1 deletion src/socket/unix_server.cr
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UNIXServer < UNIXSocket
end

# Creates a UNIXServer from an already configured raw file descriptor
def initialize(*, fd : Int32, type : Type = Type::STREAM, @path : String? = nil)
def initialize(*, fd : Handle, type : Type = Type::STREAM, @path : String? = nil)
super(fd: fd, type: type, path: @path)
end

Expand Down
2 changes: 1 addition & 1 deletion src/socket/unix_socket.cr
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class UNIXSocket < Socket
end

# Creates a UNIXSocket from an already configured raw file descriptor
def initialize(*, fd : Int32, type : Type = Type::STREAM, @path : String? = nil)
def initialize(*, fd : Handle, type : Type = Type::STREAM, @path : String? = nil)
super fd, Family::UNIX, type, Protocol::IP
end

Expand Down