Skip to content

Commit

Permalink
Change protocol socket fd to Socket::Handle (#10772)
Browse files Browse the repository at this point in the history
  • Loading branch information
straight-shoota authored Jun 4, 2021
1 parent 5ca140f commit bf809ac
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
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

0 comments on commit bf809ac

Please sign in to comment.