コード例 #1
0
ファイル: NetUtility.cs プロジェクト: fusspawn/sobriety
		/// <summary>
		/// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number (asynchronous version)
		/// </summary>
		public static void ResolveAsync(string ipOrHost, int port, ResolveEndPointCallback callback)
		{
			ResolveAsync(ipOrHost, delegate(IPAddress adr)
			{
				callback(new IPEndPoint(adr, port));
			});
		}
コード例 #2
0
 /// <summary>
 /// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number (asynchronous version)
 /// </summary>
 public static void ResolveAsync(string ipOrHost, int port, ResolveEndPointCallback callback)
 {
     ResolveAsync(ipOrHost, delegate(NetAddress adr) {
         if (adr == null)
         {
             callback(null);
         }
         else
         {
             callback(new NetEndPoint(adr, port));
         }
     });
 }
コード例 #3
0
ファイル: NetUtility.cs プロジェクト: elisee/Lidgren
 /// <summary>
 /// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number (asynchronous version)
 /// </summary>
 public static void ResolveAsync(string ipOrHost, int port, ResolveEndPointCallback callback, ResolveAddressExceptionCallback exceptionCallback = null)
 {
     ResolveAsync(ipOrHost, delegate(IPAddress adr)
     {
         if (adr == null)
         {
             callback(null);
         }
         else
         {
             callback(new IPEndPoint(adr, port));
         }
     }, exceptionCallback);
 }
コード例 #4
0
 /// <summary>
 /// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number asynchronously.
 /// </summary>
 public static void ResolveAsync(ReadOnlySpan <char> host, int port, ResolveEndPointCallback callback)
 {
     ResolveAsync(host, (resolved) =>
     {
         if (resolved == null)
         {
             callback(null);
         }
         else
         {
             callback(new IPEndPoint(resolved, port));
         }
     });
 }
コード例 #5
0
 /// <summary>
 /// Get IPv4 endpoint from notation (xxx.xxx.xxx.xxx) or hostname and port number (asynchronous version)
 /// </summary>
 public static void ResolveAsync(string ipOrHost, int port, AddressFamily addressFamily, ResolveEndPointCallback callback)
 {
     ResolveAsync(ipOrHost, addressFamily, delegate(IPAddress adr)
     {
         if (adr == null)
         {
             callback(null);
         }
         else
         {
             callback(new IPEndPoint(adr, port));
         }
     });
 }