Skip to content

Commit

Permalink
Update UdpTransport.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
andot committed Dec 17, 2019
1 parent 9effe97 commit 6a4fd38
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/@hprose/rpc-node/src/UdpTransport.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
| |
| UdpTransport for TypeScript. |
| |
| LastModified: Dec 17, 2019 |
| LastModified: Dec 18, 2019 |
| Author: Ma Bingyao <[email protected]> |
| |
\*________________________________________________________*/
Expand Down Expand Up @@ -122,7 +122,7 @@ export class UdpTransport implements Transport {
const crc = crc32(new Uint8Array(header.buffer, header.byteOffset + 4, 4));
header.writeInt32BE(crc, 0);
const body = Buffer.from(request.buffer, request.byteOffset, request.length);
socket.send([header, body], parser.port ? parseInt(parser.port, 10) : 8412, parser.hostname, (error) => {
socket.send([header, body], parser.port ? parseInt(parser.port, 10) : 8412, parser.hostname ?? undefined, (error) => {
if (error) {
delete results[index];
result.reject(error);
Expand Down

0 comments on commit 6a4fd38

Please sign in to comment.