using System; using System.Runtime.InteropServices; namespace GPSBusiness { [StructLayout(LayoutKind.Sequential)] public class ClientInfo { public IntPtr ConnId { get; set; } public string IpAddress { get; set; } public ushort Port { get; set; } public PkgInfo PkgInfo { get; set; } } [StructLayout(LayoutKind.Sequential)] public class PkgHeader { public int Id; public int BodySize; } [StructLayout(LayoutKind.Sequential)] public class PkgInfo { public bool IsHeader; public int Length; } }