xref: /third_party/node/test/parallel/test-dgram-recv-error.js (revision 1cb0ef41)
  • Home
  • History
  • Annotate Annotate
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
  • only in /third_party/node/test/parallel/
11cb0ef41Sopenharmony_ci// Flags: --expose-internals
21cb0ef41Sopenharmony_ci'use strict';
31cb0ef41Sopenharmony_ciconst common = require('../common');
41cb0ef41Sopenharmony_ciconst assert = require('assert');
51cb0ef41Sopenharmony_ciconst dgram = require('dgram');
61cb0ef41Sopenharmony_ciconst { kStateSymbol } = require('internal/dgram');
71cb0ef41Sopenharmony_ciconst s = dgram.createSocket('udp4');
81cb0ef41Sopenharmony_ciconst { handle } = s[kStateSymbol];
91cb0ef41Sopenharmony_ci
101cb0ef41Sopenharmony_cis.on('error', common.mustCall((err) => {
111cb0ef41Sopenharmony_ci  s.close();
121cb0ef41Sopenharmony_ci
131cb0ef41Sopenharmony_ci  // Don't check the full error message, as the errno is not important here.
141cb0ef41Sopenharmony_ci  assert.match(String(err), /^Error: recvmsg/);
151cb0ef41Sopenharmony_ci  assert.strictEqual(err.syscall, 'recvmsg');
161cb0ef41Sopenharmony_ci}));
171cb0ef41Sopenharmony_ci
181cb0ef41Sopenharmony_cis.on('message', common.mustNotCall('no message should be received.'));
191cb0ef41Sopenharmony_cis.bind(common.mustCall(() => handle.onmessage(-1, handle, null, null)));
20

Indexes created Thu Nov 07 10:32:03 CST 2024