%PDF- <> %âãÏÓ endobj 2 0 obj <> endobj 3 0 obj <>/ExtGState<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI] >>/Annots[ 28 0 R 29 0 R] /MediaBox[ 0 0 595.5 842.25] /Contents 4 0 R/Group<>/Tabs/S>> endobj ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<>endobj 2 0 obj<> endobj 2 0 obj<>endobj 2 0 obj<>es 3 0 R>> endobj 2 0 obj<> ox[ 0.000000 0.000000 609.600000 935.600000]/Fi endobj 3 0 obj<> endobj 7 1 obj<>/ProcSet[/PDF/Text/ImageB/ImageC/ImageI]>>/Subtype/Form>> stream
'use strict'; const common = require('../common'); const assert = require('assert'); const dgram = require('dgram'); const PORT = 12345; const client = dgram.createSocket('udp4'); client.connect(PORT, common.mustCall(() => { const remoteAddr = client.remoteAddress(); assert.strictEqual(remoteAddr.port, PORT); assert.throws(() => { client.connect(PORT, common.mustNotCall()); }, { name: 'Error', message: 'Already connected', code: 'ERR_SOCKET_DGRAM_IS_CONNECTED' }); client.disconnect(); assert.throws(() => { client.disconnect(); }, { name: 'Error', message: 'Not connected', code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' }); assert.throws(() => { client.remoteAddress(); }, { name: 'Error', message: 'Not connected', code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' }); client.once('connect', common.mustCall(() => client.close())); client.connect(PORT); })); assert.throws(() => { client.connect(PORT); }, { name: 'Error', message: 'Already connected', code: 'ERR_SOCKET_DGRAM_IS_CONNECTED' }); assert.throws(() => { client.disconnect(); }, { name: 'Error', message: 'Not connected', code: 'ERR_SOCKET_DGRAM_NOT_CONNECTED' }); [ 0, null, 78960, undefined ].forEach((port) => { assert.throws(() => { client.connect(port); }, { name: 'RangeError', message: /^Port should be > 0 and < 65536/, code: 'ERR_SOCKET_BAD_PORT' }); });