il fallait que sa puisse passer sur un cv

This commit is contained in:
Marc
2022-02-17 14:19:08 +01:00
parent 1edb531e1a
commit 551505c014
37 changed files with 13 additions and 20 deletions
+28
View File
@@ -0,0 +1,28 @@
//@ts-check
//@ts-expect-error
const csocket = require('./socket.node')
/**
* @param { number } domain
* @param { number } type
* @param { number } protocol
* @return { number }
*/
function socket(domain, type, protocol) {
return csocket.socket(domain, type, protocol)
}
const socketTypes = {
SOCK_DGRAM : 1, /* Connectionless, unreliable datagrams of fixed maximum length. */
SOCK_STREAM : 2, /* Sequenced, reliable, connection-based byte streams. */
SOCK_RAW : 3, /* Raw protocol interface. */
SOCK_RDM : 4, /* Reliably-delivered messages. */
SOCK_SEQPACKET : 5, /* Sequenced, reliable, connection-based, datagrams of fixed maximum length. */
SOCK_DCCP : 6, /* Datagram Congestion Control Protocol. */
SOCK_PACKET : 10, /* Linux specific way of getting packets at the dev level. For writing rarp and other similar things on the user level. */
SOCK_CLOEXEC : 0o2000000, /* Atomically set close-on-exec flag for the new descriptor(s). */
SOCK_NONBLOCK : 0o0000200 /* Atomically mark descriptor(s) as non-blocking. */
}
module.exports = { socketTypes, socket }