本文整理匯總了C#中bedrock.net.BaseSocket.Connect方法的典型用法代碼示例。如果您正苦於以下問題:C# BaseSocket.Connect方法的具體用法?C# BaseSocket.Connect怎麽用?C# BaseSocket.Connect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類bedrock.net.BaseSocket
的用法示例。
在下文中一共展示了BaseSocket.Connect方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Connect
/// <summary>
/// Connects the outbound socket.
/// </summary>
public override void Connect()
{
int port = (int)m_listener[Options.PORT];
Debug.Assert(port > 0);
m_sock = CreateSocket();
string to = (string)m_listener[Options.TO];
Debug.Assert(to != null);
string host = (string)m_listener[Options.NETWORK_HOST];
if ((host == null) || (host == ""))
host = to;
string url = (string)m_listener[Options.POLL_URL];
if ((url == null) || (url == ""))
{
#if !__MonoCS__
url = Address.LookupTXT("_xmppconnect.", to, "_xmpp-client-xbosh");
if (url == null)
#endif
throw new ArgumentNullException("URL not found in DNS, and not specified", "URL");
}
((IHttpSocket)m_sock).URL = url;
//Address addr = new Address(host, port);
m_sock.Connect(null, (string)m_listener[Options.SERVER_ID]);
}