neonious / lowjs

A port of Node.JS with far lower system requirements. Community version for POSIX systems such as Linux, uClinux or Mac OS X.
http://www.lowjs.org/
Other
1.27k stars 72 forks source link

Can not use Socket from net module. #120

Closed iamcco closed 4 years ago

iamcco commented 4 years ago

I try lowjs and have issue with socket.

index.js

const net = require('net')

const client = net.Socket()

run the code ./bin/low index.js

same error when run on esp32 board.

error:

TypeError: undefined not callable (property 'on' of [object Object])
    at [anon] (deps/duktape/src-low/duktape.c:67641) internal
    at Readable (lib:stream:48) strict
    at Duplex (lib:stream:500) strict
    at Socket (lib:net:124) strict
    at [anon] (/Users/aioiyuuko/my/watching/index.js:3) preventsyield
ThomasRogg commented 4 years ago

Hi! can you try net.createServer or net.connect instead of net.Socket() to create the socket, depending on whether you want to create a server or connect to a server, and then report again? Thank you! Thomas

iamcco commented 4 years ago

I test with connect and it works fine, thanks!