Network.cs 523 B

1234567891011121314151617
  1. using System;
  2. using System.Runtime.InteropServices;
  3. namespace Urho.Network {
  4. public partial class Network {
  5. [DllImport (Consts.NativeImport, CallingConvention=CallingConvention.Cdecl)]
  6. extern static int Network_Connect (IntPtr handle, string address, short port, IntPtr scene);
  7. public bool Connect (string address, short port, Scene scene)
  8. {
  9. if (address == null)
  10. throw new ArgumentNullException ("address");
  11. return Network_Connect (handle, address, port, scene?.Handle ?? IntPtr.Zero) != 0;
  12. }
  13. }
  14. }