本文整理匯總了C#中RakNet.SystemAddress.ToString方法的典型用法代碼示例。如果您正苦於以下問題:C# SystemAddress.ToString方法的具體用法?C# SystemAddress.ToString怎麽用?C# SystemAddress.ToString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類RakNet.SystemAddress
的用法示例。
在下文中一共展示了SystemAddress.ToString方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: Connect
public Task<IConnection> Connect(string endpoint)
{
logger.Debug("Connecting to endpoint {0}", endpoint);
if (_peer == null || !_peer.IsActive())
{
throw new InvalidOperationException("Transport not started. Call Start before connect.");
}
var infos = endpoint.Split(':');
var host = infos[0];
var port = ushort.Parse(infos[1]);
_peer.Connect(host, port, null, 0);
var address = new SystemAddress(host, port);
var tcs = new TaskCompletionSource<IConnection>();
_pendingConnections.TryAdd(address.ToString(), tcs);
return tcs.Task;
}
示例2: HandleOnlineServerList
protected void HandleOnlineServerList(byte[] _baData)
{
string sServerList = ASCIIEncoding.ASCII.GetString(_baData, 1, _baData.Length - 1);
string[] sServer = sServerList.Split('&');
foreach (string sMyString in sServer)
{
if (sMyString.Length > 0)
{
RakNet.SystemAddress cServerAddress = new RakNet.SystemAddress(sMyString);
m_cRnPeer.Ping(cServerAddress.ToString(), cServerAddress.GetPort(), false);
}
}
}