Changeset 648 for trunk/ab5.0/ablib/src/Classes/System/Net/IPAddress.ab
- Timestamp:
- Oct 18, 2008, 10:22:52 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Net/IPAddress.ab
r647 r648 40 40 item = malloc(size) 41 41 memcpy(item, VarPtr(ip), size) 42 End Sub 43 44 /*! 45 @brief コンストラクタ 46 @param SocketAddressクラスから作成 47 @note このコンストラクタはライブラリ内のみで使用する目的で作られています。 48 */ 49 Sub IPAddress(address As SocketAddress) 50 family = address.AddressFamily 51 Select Case family 52 Case AF_INET 53 Dim addr4 = address.Items As *sockaddr_in 54 size = SizeOf(in_addr) 55 item = malloc(size) 56 memcpy(item, VarPtr(addr4->sin_addr.s_addr), size) 57 Case AF_INET6 58 Dim addr6 = address.Items As *sockaddr_in6 59 size = SizeOf(in6_addr) 60 item = malloc(size) 61 memcpy(item, VarPtr(addr6->sin6_addr.s6_addr), size) 62 Case Else 63 Throw New NotSupportedException("IPAddress: Not Supported AddressFamily.") 64 End Select 42 65 End Sub 43 66
Note:
See TracChangeset
for help on using the changeset viewer.