![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.
connection
Advanced tools
connection socket wrapper
const net = require('net');
const awaitFirst = require('await-first');
const Connection = require('connection');
const Decoder = require('sofa-bolt-node/lib/decoder');
const Encoder = require('sofa-bolt-node/lib/encoder');
// bolt protocol example
const protocol = {
name: 'Rpc',
encoder: opts => new Encoder(opts),
decoder: opts => new Decoder(opts),
};
async function createConnection(hostname, port) {
const socket = net.connect(port, hostname);
await awaitFirst(socket, [ 'connect', 'error' ]);
return new Connection({
logger: console,
socket,
protocol,
});
}
const conn = await createConnection('127.0.0.1', 12200);
conn.writeRequest({
targetAppName: 'foo',
args: [ 'peter' ],
serverSignature: 'com.alipay.sofa.rpc.quickstart.HelloService:1.0',
methodName: 'sayHello',
methodArgSigs: [ 'java.lang.String' ],
requestProps: null,
});
const Connection = require('connection');
const server = net.createServer();
server.listen(port);
server.on('connection', sock => {
const conn = new Connection({
logger: console,
socket: sock,
protocol,
});
conn.on('request', req => {
conn.writeResponse(req, {
error: null,
appResponse: 'hello, peter',
responseProps: null,
});
});
});
interface Request {
/**
* If request is oneway, shoule set to true
*/
oneway: boolean,
/**
* writeRequest will use the timeout to set the timer
*/
timeout: number,
/**
* request packet type, request|heartbeat|response
*/
packetType: string,
}
interface Response {
packetId: number,
}
interface Encoder extends Transform {
/**
* write request to socket
* Connection#writeRequest and Connection#oneway will call the function.
* @param {number} id - the request id
* @param {Object} req - the request object should be encoded
* @param {Function} cb - the encode callback
*/
writeRequest(id: number, req: object, cb);
/**
* write response to socket
* Connection#writeResponse will call the function.
* @param {Object} req - the request object
* @param {Object} res - the response object should be encoded
* @param {Function} cb - the encode callback
*/
writeResponse(req: object, res: object, cb);
}
interface Decoder extends Writable {
// events
// - request emit when have request packet
// - heartbeat emit when have heartbeat packet
// - response emit when have response packet
}
interface Protocol {
name: string;
encode(options: any): Encoder;
decode(options: any): Decoder;
}
killagu | gxcsoccer | popomore | weijiafu14 |
---|
This project follows the git-contributor spec, auto updated at Wed Jun 19 2024 17:29:25 GMT+0800
.
1.5.0 (2024-06-19)
features
8a5c908
] - feat: impl writeHeartbeat/writeHeartbeatAck (weijiafu14 <1527752351@qq.com>)features
c8fb1b8
] - feat: add ts type definition (#5) (killa <killa123@126.com>)features
60afa93
] - feat: add protocolOptions (killagu <killa123@126.com>)features
f518e35
] - feat: oneway should throw encode error (killagu <killa123@126.com>)others ,fatal: No names found, cannot describe anything.
FAQs
wrap for socket
The npm package connection receives a total of 0 weekly downloads. As such, connection popularity was classified as not popular.
We found that connection demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 15 open source maintainers 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.