No description
Find a file
2025-03-06 18:18:54 -06:00
.github/workflows Add build/publish to NuGet workflow 2025-03-06 18:18:54 -06:00
IPXRelay Allow use of cancellation token 2025-03-06 18:04:21 -06:00
IPXRelay.Server Change sample application to use console logger 2024-01-06 20:54:26 -06:00
.gitignore Initial commit 2023-09-07 20:39:50 -05:00
IPXRelay.sln Change namespace for library to IPXRelayDotNet. Remove unnecessary packages. 2023-09-08 18:28:03 -05:00
LICENSE Initial commit 2023-09-07 20:39:50 -05:00
package-icon.png Update icon 2025-03-06 18:18:25 -06:00
README.md Update README 2025-03-06 18:12:06 -06:00

IPXRelayDotNet

IPXRelayDotNet is a .NET library to relay UDP-encapsulated IPX packets from DOSBox to other connected DOSBox clients. It can replace the need for one client to act as the server. The library utilizes asynchronous sockets, and thus .NET 7 is required.

Quick Start

Implementation is easy. Included in this repository is the project IPXRelay.Server that is a very basic relay server. The most minimal usage of the library in a console application may look like this:

using IPXRelayDotNet;
...
using (var relay = new IPXRelay())
{
	relay.StartAsync().Wait();
}

This will start the relay using a default port of 213.

Configurable Options

The only option that really might need to be configured with the relay is the port in which it will listen. This can be customized when setting up the relay:

using IPXRelayDotNet;
...
var port = 33213;
using (var relay = new IPXRelay(port))
{
	relay.StartAsync().Wait();
}

Logging

Some basic logging has been implemented using the abstraction Microsoft.Extensions.Logging so it can be used with loggers such as nlog or Serilog.

Logging can be manually disabled in cases where dependency injection may get in the way by using the method IPXRelay.DisableLogging();

Event Handlers

Event handlers exist for the following:

  • OnClientConnected: Fires whenever a client connects
  • OnReceivePacketError: Fires when an exception occurs while trying to receive a packet
  • OnReceivePacket: Fires when a packet has been received and deserialized into an IPXPacket
  • OnSendPacket: Fires after a packet has been sent to a client
  • OnSendPacketError: Fires when an exception occurs while trying to send a packet to a client

Cancellation Tokens

The StartAsync method supports cancellation tokens. This can be used to gracefully stop the relay.