public string GetHost() { StringBuilder hostName = new StringBuilder(1024); if (Native.enet_address_get_host(nativeAddress, hostName, (IntPtr)hostName.Capacity) != 0) { return(String.Empty); } return(hostName.ToString()); }
public string GetHost() { StringBuilder sb = new StringBuilder(255); if (Native.enet_address_get_host(ref nativeAddress, sb, sb.Capacity) != 0) { return(null); } return(sb.ToString()); }
public string GetName() { byte[] data = new byte[256]; if (Native.enet_address_get_host(ref nativeAddress, data, (IntPtr)256) == 0) { return(Encoding.ASCII.GetString(data)); } else { return(String.Empty); } }
public string GetHostName() { var name = new byte[256]; fixed(byte *hostName = name) { if (Native.enet_address_get_host(ref _address, hostName, (IntPtr)name.Length) < 0) { return(null); } } return(BytesToString(name)); }