mirror of
https://github.com/cccb/servicepoint.git
synced 2025-01-19 10:20:12 +01:00
22 lines
441 B
C#
22 lines
441 B
C#
using System.Text;
|
|
|
|
namespace ServicePoint;
|
|
|
|
public sealed partial class Connection
|
|
{
|
|
public static Connection? Open(string host)
|
|
{
|
|
unsafe
|
|
{
|
|
fixed (byte* bytePtr = Encoding.UTF8.GetBytes(host))
|
|
{
|
|
return Open(bytePtr);
|
|
}
|
|
}
|
|
}
|
|
|
|
public bool Send(Packet packet) => SendPacket(packet);
|
|
|
|
public bool Send(Command command) => SendCommand(command);
|
|
}
|