Skip to content

Commit

Permalink
attempted fix of port number issue
Browse files Browse the repository at this point in the history
  • Loading branch information
ohuu committed Jul 4, 2022
1 parent 556c197 commit a097896
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion local/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "local",
"version": "2.1.0",
"version": "2.1.1",
"main": "dist/main/index.cjs",
"author": "草鞋没号 <308487730@qq.com>",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions local/packages/main/flows/udp/udpSink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { observerToUdp } from "../../rxadapters/rxUdp";
import { useUdpSocket } from "./useUdpSocket";

const sendingSockets: dgram.Socket[] = [];
let nextPort = 5001;
let nextPort = 5000;

export interface UdpSinkOptions {
name: string;
Expand Down Expand Up @@ -50,7 +50,7 @@ export function udpSink(options: UdpSinkOptions): Promise<UdpSink> {

// create a new observer from the socket to observe the source
const toAddress = options.toAddress ?? "127.0.0.1";
const toPort = options.toPort ?? nextPort++;
const toPort = options.toPort ?? existingSocket ? nextPort : ++nextPort;
return socket
.then((socket) => observerToUdp(toAddress, toPort, socket, options.sender, options.debug))
.then((observer) => {
Expand Down

0 comments on commit a097896

Please sign in to comment.