![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
@j-o-r/filesocket
Advanced tools
FileSocket is a simple implementation of a Unix domain socket server and client using Node.js. This project demonstrates how to create a basic inter-process communication (IPC) mechanism using Unix domain sockets. The server listens for incoming connections and processes messages, while the client sends messages to the server and handles responses.
npm i @j-o-r/filesocket --save
The server listens on a Unix domain socket file and processes incoming messages. It uses a custom handler function to process the messages and send responses.
import FS from '@j-o-r/filesocket';
const socketFile = '/path/to/socket/file.sock';
const server = new FS.server(socketFile, (message) => {
console.log('Received message:', message);
server.write(`${message}: Response from server`);
});
// To close the server
// server.close();
The client connects to the Unix domain socket file and sends messages to the server. It waits for the server's response and handles it accordingly.
import FS from '@j-o-r/filesocket';
const socketFile = '/path/to/socket/file.sock';
const client = new FS.client(socketFile);
client.write('Hello, server!')
.then(response => {
console.log('Received response:', response);
})
.catch(error => {
console.error('Error:', error);
});
The project includes test cases using the uvu
test framework. To run the tests, use the following command:
npm test
The tests are defined in the socket.js
file and verify the basic functionality of the server and client.
lib/FSClient.js
: Defines the FSClient
class for the client.lib/FSServer.js
: Defines the FSServer
class for the server.lib/FileSocket.js
: Imports and exports the FSServer
and FSClient
classes.scenarios/socket.js
: Contains test cases for the server and client.This project is licensed under the APACHE 2.0 License. See the LICENSE file for details.
FAQs
A simple implementation of a Unix domain socket server and client.
We found that @j-o-r/filesocket demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.