Я пытаюсь подключиться к Teamspeak3, используя TS3QueryLib.Но я получил сообщение об ошибке: Ошибка сокета!Код ошибки: TimedOut.Кроме того, нет возможности добавить пароль в строку подключения для сервера.
using TS3QueryLib.Core;
using TS3QueryLib.Core.Common;
using TS3QueryLib.Core.Common.Responses;
using TS3QueryLib.Core.Communication;
using TS3QueryLib.Core.Server;
using TS3QueryLib.Core.Server.Responses;
То есть функция подключения:
public void Connect()
{
// do not connect when already connected or during connection establishing
if (QueryDispatcher != null)
return;
if (string.IsNullOrWhiteSpace(ServerAddressTextBox.Text))
{
MessageBox.Show("Please provide a server address!");
return;
}
ushort port;
if (!ushort.TryParse(ServerPort.Text, out port))
{
MessageBox.Show("Please provide a valid query port!");
return;
}
UpdateUI(ConnectionState.Connecting);
QueryDispatcher = new AsyncTcpDispatcher(ServerAddressTextBox.Text.Trim(), port);
QueryDispatcher.BanDetected += QueryDispatcher_BanDetected;
QueryDispatcher.ReadyForSendingCommands += QueryDispatcher_ReadyForSendingCommands;
QueryDispatcher.ServerClosedConnection += QueryDispatcher_ServerClosedConnection;
QueryDispatcher.SocketError += QueryDispatcher_SocketError;
QueryDispatcher.Connect();
}