Skip to content

Commit

Permalink
Minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
patrick-dmxc committed Feb 2, 2024
1 parent 5f6aaac commit f7a6ea6
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ArtNetSharp/ArtNet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,8 @@ private void processReceivedData(IPv4Address localIpAddress, UdpReceiveResult re
byte[] received = result.Buffer;
try
{
processPacket(Tools.DeserializePacket(received), localIpAddress, RemoteIpEndPoint.Address);
IPv4Address sourceIp = RemoteIpEndPoint.Address;
processPacket(Tools.DeserializePacket(received), localIpAddress, sourceIp);
}
catch (ObjectDisposedException ed) { Logger.LogTrace(ed); }
catch (SocketException se) { Logger.LogTrace(se); }
Expand Down
8 changes: 8 additions & 0 deletions Examples/ControllerExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
using ArtNetSharp;
using ArtNetSharp.Communication;
using System.Net;

Console.WriteLine("Controller Example!");

//Add Logging
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY);

//Set Networkinterfaces
var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));

// Create Instance
ControllerInstance controllerInstance = new ControllerInstance();
controllerInstance.Name = controllerInstance.ShortName = "Controller Example";
Expand Down
8 changes: 8 additions & 0 deletions Examples/NodeInputExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
using ArtNetSharp;
using ArtNetSharp.Communication;
using System.Net;

Console.WriteLine("Node Input Example!");

//Add Logging
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY);

//Set Networkinterfaces
var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));

// Create Instance
NodeInstance nodeInstance = new NodeInstance();
nodeInstance.Name = nodeInstance.ShortName = "Node Input Example";
Expand Down
8 changes: 8 additions & 0 deletions Examples/NodeOutputExample/Program.cs
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
using ArtNetSharp;
using ArtNetSharp.Communication;
using System.Net;

Console.WriteLine("Node Output Exampler!");

//Add Logging
//ArtNet.SetLoggerFectory(YOUR_LOGGER_FACTORY);

//Set Networkinterfaces
var broadcastIp = new IPAddress(new byte[] { 2, 255, 255, 255 });
ArtNet.Instance.NetworkClients.ToList().ForEach(ncb => ncb.Enabled = IPAddress.Equals(broadcastIp, ncb.BroadcastIpAddress));

// Create Instance
NodeInstance nodeInstance = new NodeInstance();
nodeInstance.Name = nodeInstance.ShortName = "Node Output Example";
Expand Down

0 comments on commit f7a6ea6

Please sign in to comment.