Skip to content

Commit b526a17

Browse files
committed
Create sockets via fallible constructors
1 parent d1306ce commit b526a17

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

wit-0.3.0-draft/types.wit

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,7 @@ interface types {
152152
/// - <https://man7.org/linux/man-pages/man2/socket.2.html>
153153
/// - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw>
154154
/// - <https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
155-
@since(version = 0.3.0-rc-2025-08-15)
156-
create: static func(address-family: ip-address-family) -> result<tcp-socket, error-code>;
155+
constructor(address-family: ip-address-family) -> result<tcp-socket, error-code>;
157156

158157
/// Bind the socket to the provided IP address and port.
159158
///
@@ -511,8 +510,7 @@ interface types {
511510
/// - <https://man7.org/linux/man-pages/man2/socket.2.html>
512511
/// - <https://learn.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-wsasocketw>
513512
/// - <https://man.freebsd.org/cgi/man.cgi?query=socket&sektion=2>
514-
@since(version = 0.3.0-rc-2025-08-15)
515-
create: static func(address-family: ip-address-family) -> result<udp-socket, error-code>;
513+
constructor(address-family: ip-address-family) -> result<udp-socket, error-code>;
516514

517515
/// Bind the socket to the provided IP address and port.
518516
///

0 commit comments

Comments
 (0)