agracio / edge-js

Run .NET and Node.js code in-process on Windows, macOS, and Linux

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Could anybody help writing the below code in nodeJS?

hmpmarketing opened this issue · comments

Hi,

I need to access a MemoryMappedFile (Windows) with nodeJS code, the C equivalent is below:

using System;
using System.IO.MemoryMappedFiles;

class HelloWorld
{
    static void Main()
    {
        double Ask = -1;
        while (true){
            MemoryMappedFile RateFile = MemoryMappedFile.OpenExisting("Global\\KEY");
            if (RateFile != null)
            {
                var accessor = RateFile.CreateViewAccessor();
                Ask = accessor.ReadDouble(sizeof(double));
                accessor.Dispose();
                Console.WriteLine("ASK: " + Ask);
            }
            RateFile.Dispose();
        }
        //return true;
    }
}



How could I write this in nodeJS?

Thank you so much

Not relevant to edge-js