连接
是否连接
- C#
- JavaScript
namespace Serein.Core.Services.Network.Connection;
public partial class WsConnectionManager
{
public bool Active { get; }
}
serein.connection.active
- 类型
boolean
启动
- C#
- JavaScript
namespace Serein.Core.Services.Network.Connection;
public partial class WsConnectionManager
{
public void Start();
}
serein.connection.start(): void
- 若已连接则会报错,可用
try...catch
捕获
停止
- C#
- JavaScript
namespace Serein.Core.Services.Network.Connection;
public partial class WsConnectionManager
{
public void Stop();
}
serein.connection.stop(): void
- 若未连接则会报错,可用
try...catch
捕获
发送文本
- C#
- JavaScript
using System.Threading.Tasks;
namespace Serein.Core.Services.Network.Connection;
public partial class WsConnectionManager
{
public Task SendDataAsync(string data);
}