Skip to content

Commit

Permalink
Fix repeat interval timer updating after property change.
Browse files Browse the repository at this point in the history
  • Loading branch information
basildane committed Dec 9, 2016
1 parent 7da4bf8 commit 752cd75
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
5 changes: 2 additions & 3 deletions Listener.vb
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,9 @@ Public Class Listener
Try
_gso.EndPoint = New IPEndPoint(IPAddress.Any, RegExTextBoxPort.Text)
_gso.Socket = New Socket(AddressFamily.InterNetwork, SocketType.Dgram, ProtocolType.Udp)
'_gso.Socket = New Socket(AddressFamily.InterNetwork, SocketType.Raw, ProtocolType.IP)
_gso.Socket.EnableBroadcast = True

_gso.Socket.SetSocketOption(SocketOptionLevel.Socket, SocketOptionName.ReuseAddress, True)
'_gso.Socket.SetSocketOption(SocketOptionLevel.IP, SocketOptionName.HeaderIncluded, True)
_gso.Socket.ExclusiveAddressUse = False

_gso.Socket.Bind(_gso.EndPoint)
Expand Down Expand Up @@ -109,6 +107,7 @@ Public Class Listener
ListView1.Invoke(_showHit, so, bytesRead, packetInfo)
Else
Dim li As New ListViewItem
ListView1.BeginUpdate()

mac = Parse(so.Buffer, bytesRead)
li.Text = mac
Expand Down Expand Up @@ -140,7 +139,6 @@ Public Class Listener
TextBoxDetails.AppendText(String.Format("{0,-20}{1}{2}", "Length: ", bytesRead, Environment.NewLine))
TextBoxDetails.AppendText(String.Format("{0,-20}{1}{2}", "Protocol: ", so.Socket.ProtocolType.ToString(), Environment.NewLine))
TextBoxDetails.AppendText(String.Format("{0,-20}{1}{2}", "Port: ", RegExTextBoxPort.Text, Environment.NewLine))
'TextBoxDetails.AppendText(String.Format("{0,-20}{1}{2}", "TTL: ", so.Socket.Ttl.ToString(), Environment.NewLine))
TextBoxDetails.AppendText(String.Format("{0,-20}{1}{2}", "Hostname: ", hostName, Environment.NewLine))

TextBoxDetails.AppendText(String.Format("{0,-20}{1}{2}{2}", "MAC Address:", mac, Environment.NewLine))
Expand All @@ -158,6 +156,7 @@ Public Class Listener
Next

TextBoxDetails.AppendText(String.Format("{0}{0}", Environment.NewLine))
ListView1.EndUpdate()

If My.Settings.Sound Then
My.Computer.Audio.Play(My.Resources.blip, AudioPlayMode.Background)
Expand Down
3 changes: 1 addition & 2 deletions Wake.vb
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,8 @@ Module Wake
newMachine = New repeatingMachine(machine)
newMachine.remainingCount = machine.RepeatCount - 1
repeatMachine.Add(newMachine)

repeatTimer.Interval = My.Settings.repeatInterval
If repeatTimer.Enabled = False Then
repeatTimer.Interval = My.Settings.repeatInterval
repeatTimer.Enabled = True
AddHandler repeatTimer.Tick, AddressOf RepeatTimerEvent
End If
Expand Down

0 comments on commit 752cd75

Please sign in to comment.