Skip to content

Adding socket functionality #739

@snapo

Description

@snapo

Sometime you need external data/ events whatever.... is there a way to use sockets?

for example:
IO/Socket/open (addr: String, port: u24) -> u24
IO/Socket/send (socket: u24, bytes: List(u24)) -> IO Result(u24)
IO/Socket/recv (socket: u24, max_bytes: u24) -> IO Result(List(u24))
IO/Socket/close (socket: u24) -> IO None

this would allow then to
socket <- IO/Socket/open("127.0.0.1", 8080)

  • <- IO/Socket/send(socket, String/encode_utf8("Hello, World!"))
    response <- IO/Socket/recv(socket, 1024)
  • <- IO/Socket/close(socket)

(what i dont get is , if the code runs then on the GPU, there would always have to be a read/write object or a socket between gpu und the socket that runs on the cpu....)

is there anything planned? or did i overlook something?

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestpreludeBend's builtin types and functions

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions