Code Monkey home page Code Monkey logo

Comments (8)

joshgoebel avatar joshgoebel commented on June 25, 2024 3

Disclaimer: I'm new to Wren and it's embedding and C++ is not my best language, and low-level networking is not the simplest... so go easy on me. But if anyone had comments or wanted to try it out, test it, etc... there is no outbound connections, this is just a TCP server that handles incoming connections.

There is probably all sorts of ugly, missing error handling, and really there should probably be hooks for disconnect, etc... This should be considered like an alpha version.

https://github.com/joshgoebel/wren-cli/tree/network

A simple echo server:

import "socket" for TCPServer

var server = TCPServer.new("127.0.0.1",7000)
server.onConnect = Fn.new() { |conn|
    conn.writeLn("Hello, user.")
    var x 
    while (x = conn.readWait()) {
        conn.write(x)
    }
}
server.serve()

Very open to a high level discussion of what primitives we need to flesh this out.

from wren-cli.

joshgoebel avatar joshgoebel commented on June 25, 2024 2

OMG, a simple MUD or something in Wren would be pretty awesome.

from wren-cli.

minirop avatar minirop commented on June 25, 2024

libuv is only used in the CLI, wren itself doesn't know anything. You could build up on the CLI or doing something similar from scratch.

from wren-cli.

masoodahm avatar masoodahm commented on June 25, 2024

ok I will try that

from wren-cli.

munificent avatar munificent commented on June 25, 2024

The short answer is no, the Wren CLI doesn't currently expose libuv's networking API. I intend to, I just haven't gotten there yet.

from wren-cli.

aosenkidu avatar aosenkidu commented on June 25, 2024

This seems not to be in your repository @joshgoebel.
Might it be in a branch you have not committed to github yet?

from wren-cli.

joshgoebel avatar joshgoebel commented on June 25, 2024

https://github.com/joshgoebel/wren-console/blob/network/src/module/network.wren

The stuff I was working on can be found in the branch I pointed to.

from wren-cli.

aosenkidu avatar aosenkidu commented on June 25, 2024

https://github.com/joshgoebel/wren-console/blob/network/src/module/network.wren

The stuff I was working on can be found in the branch I pointed to.

Thank you :D however, the link I answered to: is either a different repository or a different branch. So no reason to "down thumb" a valid question.

Perhaps I just don't grasp the github webinterface ...

from wren-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.