Skip to content

Commit

Permalink
fix: typo
Browse files Browse the repository at this point in the history
  • Loading branch information
robertsLando committed Apr 3, 2024
1 parent b7c4cb8 commit d3d8f09
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions src/IpRoutingConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ import type { KnxFSMConnection } from './FSM'
function IpRoutingConnection(instance: KnxFSMConnection): KnxFSMConnection {
const log = KnxLog.get()

instance.BindSocket = (cb: (socket: dgram.Socket) => void) => {
instance.BindSocket = function BindSocket(
cb: (socket: dgram.Socket) => void,
) {
const udpSocket = dgram.createSocket({ type: 'udp4', reuseAddr: true })
udpSocket.on('listening', () => {
log.debug(
Expand Down Expand Up @@ -37,7 +39,7 @@ function IpRoutingConnection(instance: KnxFSMConnection): KnxFSMConnection {
// <summary>
/// Start the connection
/// </summary>
instance.Connect = () => {
instance.Connect = function Connect() {
this.localAddress = this.getLocalAddress()
this.socket = this.BindSocket((socket: dgram.Socket) => {
socket.on('error', (errmsg: string) =>
Expand Down
6 changes: 4 additions & 2 deletions src/IpTunnelingConnection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ import type { KnxFSMConnection } from './FSM'
function IpTunnelingConnection(instance: KnxFSMConnection) {
const log = KnxLog.get()

instance.BindSocket = (cb: (socket: dgram.Socket) => void) => {
instance.BindSocket = function BindSocket(
cb: (socket: dgram.Socket) => void,
) {
const udpSocket = dgram.createSocket('udp4')
udpSocket.bind(() => {
log.debug(
Expand All @@ -18,7 +20,7 @@ function IpTunnelingConnection(instance: KnxFSMConnection) {
return udpSocket
}

instance.Connect = () => {
instance.Connect = function Connect() {
this.localAddress = this.getLocalAddress()
// create the socket
this.socket = this.BindSocket((socket: dgram.Socket) => {
Expand Down

0 comments on commit d3d8f09

Please sign in to comment.