Skip to content

Commit

Permalink
Rewrite to use the HighPerfComm package
Browse files Browse the repository at this point in the history
  • Loading branch information
HakanL committed Dec 12, 2024
1 parent 688fab4 commit 24f7a4f
Show file tree
Hide file tree
Showing 129 changed files with 502 additions and 293 deletions.
4 changes: 4 additions & 0 deletions ArtNet/ArtNet/IO/ArtNetReceiveData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,5 +18,9 @@ public ushort OpCode
return (ushort)(this.buffer[8] + (this.buffer[9] << 8));
}
}

public ArtNetReceiveData()
{
}
}
}
12 changes: 11 additions & 1 deletion ArtNet/ArtNet/Packets/ArtNetPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ namespace Haukcode.ArtNet.Packets
{
public class ArtNetPacket
{
public const int MAX_PACKET_SIZE = 572;

public ArtNetPacket(ArtNetOpCodes opCode)
{
OpCode = opCode;
Expand Down Expand Up @@ -85,7 +87,15 @@ public virtual void WriteData(ArtNetBinaryWriter data)
data.WriteHiLoInt16(Version);
}

public static ArtNetPacket Create(ArtNetReceiveData data, Func<ushort, ArtNetReceiveData, ArtNetPacket> customPacketCreator)
public static ArtNetPacket Parse(ReadOnlyMemory<byte> buffer)
{
var data = new ArtNetReceiveData();
buffer.Span.CopyTo(data.buffer);

return Create(data, null);
}

public static ArtNetPacket Create(ArtNetReceiveData data, Func<ushort, ArtNetReceiveData, ArtNetPacket>? customPacketCreator)
{
switch ((ArtNetOpCodes)data.OpCode)
{
Expand Down
3 changes: 1 addition & 2 deletions ArtNet/ArtNet/Packets/ArtPollReplyPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Text;
using System.Net;
using Haukcode.ArtNet.IO;
using Haukcode.ArtNet.Sockets;

namespace Haukcode.ArtNet.Packets
{
Expand Down Expand Up @@ -49,7 +48,7 @@ public byte[] RespUID
}
}

private short port = ArtNetSocket.Port;
private short port = ArtNetClient.DefaultPort;

public short Port
{
Expand Down
243 changes: 0 additions & 243 deletions ArtNet/ArtNet/Sockets/ArtNetSocket.cs

This file was deleted.

Loading

0 comments on commit 24f7a4f

Please sign in to comment.