Changeset 649 for trunk/ab5.0
- Timestamp:
- Oct 19, 2008, 11:25:55 AM (16 years ago)
- Location:
- trunk/ab5.0/ablib/src/Classes/System/Net
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/src/Classes/System/Net/EndPoint.ab
r648 r649 21 21 @return SocketAddressを元に作成したEndPoint 22 22 */ 23 Function Create(address As SocketAddress) As EndPoint 24 socketAddress = address 23 Static Function Create(address As SocketAddress) As EndPoint 24 Dim point = New EndPoint 25 point.socketAddress = address 26 Return point 25 27 End Function 26 28 -
trunk/ab5.0/ablib/src/Classes/System/Net/IPAddress.ab
r648 r649 47 47 @note このコンストラクタはライブラリ内のみで使用する目的で作られています。 48 48 */ 49 Sub IPAddress(addr ess As SocketAddress)50 family = addr ess.AddressFamily49 Sub IPAddress(addr As *sockaddr) 50 family = addr.sa_family 51 51 Select Case family 52 52 Case AF_INET 53 Dim addr4 = addr ess.ItemsAs *sockaddr_in53 Dim addr4 = addr As *sockaddr_in 54 54 size = SizeOf(in_addr) 55 55 item = malloc(size) 56 56 memcpy(item, VarPtr(addr4->sin_addr.s_addr), size) 57 57 Case AF_INET6 58 Dim addr6 = addr ess.ItemsAs *sockaddr_in658 Dim addr6 = addr As *sockaddr_in6 59 59 size = SizeOf(in6_addr) 60 60 item = malloc(size) … … 63 63 Throw New NotSupportedException("IPAddress: Not Supported AddressFamily.") 64 64 End Select 65 End Sub 66 67 /*! 68 @brief コンストラクタ 69 @param IPアドレスを表したバイト列 70 @param IPアドレスの長さ 71 @note このコンストラクタはライブラリ内のみで使用する目的で作られています。 72 */ 73 Sub IPAddress(af As DWord, address As *Byte, len As Long) 74 family = af 75 size = len 76 item = malloc(size) 77 memcpy(item, address, size) 65 78 End Sub 66 79 … … 213 226 */ 214 227 Static Function Any() As IPAddress 215 Return New IPAddress(0 )228 Return New IPAddress(0 As DWord) 216 229 End Function 217 230 -
trunk/ab5.0/ablib/src/Classes/System/Net/IPEndPoint.ab
r648 r649 15 15 Inherits EndPoint 16 16 Public 17 18 /*! 19 @brief コンストラクタ 20 */ 21 Sub IPEndPoint() 22 End Sub 17 23 18 24 /*! … … 61 67 */ 62 68 Function Address() As IPAddress 63 Return New IPAddress(socketAddress )69 Return New IPAddress(socketAddress.Items) 64 70 End Function 65 71 … … 96 102 Throw New NotSupportedException("IPEndPoint.Port: Unknown AddressFamily.") 97 103 End Select 104 End Function 105 106 /*! 107 @brief SocketAddressクラスから作成する 108 @param SocketAddressクラス 109 @return SocketAddressを元に作成したIPEndPoint 110 */ 111 Static Function Create(address As SocketAddress) As IPEndPoint 112 Dim point = New IPEndPoint 113 point.socketAddress = address 114 Return point 98 115 End Function 99 116 -
trunk/ab5.0/ablib/src/Classes/System/Net/SocketAddress.ab
r648 r649 38 38 Sub SocketAddress(family As Sockets.AddressFamily, size As Long) 39 39 init(family, size) 40 End Sub 41 42 /*! 43 @brief コンストラクタ。sockaddrを指定して初期化する 44 @param sockaddr構造体 45 @note このコンストラクタはライブラリ内でのみ使用する目的で作られています。 46 */ 47 Sub SocketAddress(addr As *sockaddr, len As Long) 48 itemSize = len 49 item = malloc(itemSize) 50 memcpy(item, addr, itemSize) 40 51 End Sub 41 52
Note:
See TracChangeset
for help on using the changeset viewer.