servicepoint/crates/servicepoint_binding_cs/ServicePoint/Connection.cs

22 lines
441 B
C#
Raw Permalink Normal View History

2024-05-13 00:17:40 +02:00
using System.Text;
namespace ServicePoint;
2024-05-13 00:17:40 +02:00
public sealed partial class Connection
2024-05-13 00:17:40 +02:00
{
public static Connection? Open(string host)
2024-05-13 00:17:40 +02:00
{
unsafe
{
fixed (byte* bytePtr = Encoding.UTF8.GetBytes(host))
{
return Open(bytePtr);
2024-05-13 00:17:40 +02:00
}
}
}
public bool Send(Packet packet) => SendPacket(packet);
2024-05-13 00:17:40 +02:00
public bool Send(Command command) => SendCommand(command);
2024-05-13 00:17:40 +02:00
}