[quickjs-devel] Re: tcp/udp sockets

  • From: Pranav Samvith Bharadwaja <pranav@xxxxxxxxxx>
  • To: quickjs-devel@xxxxxxxxxxxxx
  • Date: Mon, 30 Jan 2023 21:26:23 +0530

Update:
  I found a resource on medium.
https://calbertts.medium.com/how-to-create-asynchronous-apis-for-quickjs-8aca5488bb2e
  but in this resource they use the process module to invoke the curl
command to make a http request. Perhaps the medium resource is missing
something, or they just decided to use a simple tool (curl) instead of
opening a socket and sending uri and headers?
  If tcp sockets are not implemented at all, is there any way in which I
might go about implementing a sockets built-in module for the qjs engine?
  Similarly I would like to implement a way to load local files and send
them to a remote client.
  This resource also claims that qjs uses select instead of libuv. is there
a build option using which I can choose whether to use select/poll/epoll or
libuv? or would i need to implement that as an option in the qjs engine
code as well? Is select much slower than libuv for an application that
mostly deals with io over tcp sockets and rarely ever needs to read/write
files?
I would appreciate any advice in this matter.
Thanks,
Pranav

On Mon, Jan 30, 2023 at 12:18 PM Pranav Samvith Bharadwaja <
pranav@xxxxxxxxxx> wrote:


Greetings,
  I have seen this mailchain

https://www.freelists.org/post/quickjs-devel/Newbie-Getting-something-like-require-to-work,1
  I think it is reasonable that net, fs and path are not implemented in
qjs. But is there an alternative by which we could create tcp/udp sockets?
  I am trying to compile a node.js project and with some custom edits to
some node modules, able to bundle them all into a single file (because
require doesnt work with qjs). A database driver would inevitably use the
net built-in module. If an alternative is available i could make
customization for qjs backend versus pre-existing nodejs. Any help is
appreciated.
--
Thanks and Regards,
Pranav.


Other related posts: