我正在尝试为服务器c++文件实现一个UDP套接字。我有下面的代码来设置套接字
//Create the server socket
if ((s = socket(AF_INET, SOCK_DGRAM, 0)) == INVALID_SOCKET)
throw "can't initialize socket";
//Fill-in Server Port and Address info.
sa.sin_family = AF_INET;
sa.sin_port = htons(port);
sa.sin_
以下是Node.js代码:
net = require('net');
fs = require('fs');
serverSocketFile = '/tmp/_mediaComm';
if (fs.existsSync(serverSocketFile))
fs.unlinkSync(serverSocketFile);
var server = net.createServer((socket) => {
console.log