zigself
zigself copied to clipboard
Socket API
A way to expose the BSD socket API in Unix-like operating systems to Self code with the use of primitives.
- [ ] Figure out a way to create sockaddr structs in Self memory in a way that's not super unintuitive (manually writing bytes)
- [x]
_GetAddrInfoForHost:Port:Family:SocketType:Protocol:Flags:IfFail:- This one will return slots objects copied from a prototype that's defined directly in VM code. I'm thinking of hardcoding this directly for the time being, but it's clear that we are going to have more of these so having a better interface for defining objects like this would be nice.
- [x]
_SocketWithFamily:Type:Protocol:IfFail: - [x]
_Connect:ToSockaddrBytes:IfFail: - [x]
_Bind:ToSockaddrBytes:IfFail: - [x]
_ListenOn:WithBacklog:IfFail: - [x]
_AcceptFrom:WritingDetailsTo:IfFail: - [ ]
_Recv:BytesInto:AtOffset:From:Flags:IfFail: - [ ]
_Send:BytesFrom:AtOffset:Into:Flags:IfFail: - [ ] Get rid of the FIXMEs