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