| 1 | package SPVM::Sys::Socket::Sockaddr; | ||
| 2 | |||
| 3 | 1; | ||
| 4 | |||
| 5 | =head1 Name | ||
| 6 | |||
| 7 | SPVM::Sys::Socket::Sockaddr - struct sockaddr in the C language | ||
| 8 | |||
| 9 | =head1 Description | ||
| 10 | |||
| 11 | Sys::Socket::Sockaddr class in L<SPVM> represents L<struct sockaddr|https://linux.die.net/man/7/ip> in the C language. | ||
| 12 | |||
| 13 | =head1 Usage | ||
| 14 | |||
| 15 | use Sys::Socket::Sockaddr; | ||
| 16 | |||
| 17 | =head1 Details | ||
| 18 | |||
| 19 | This class is a pointer class. The pointer the instance has is set to a L<struct sockaddr|https://linux.die.net/man/7/ip> object. | ||
| 20 | |||
| 21 | =head1 Interfaces | ||
| 22 | |||
| 23 | =over 2 | ||
| 24 | |||
| 25 | =item L<Cloneable|SPVM::Cloneable> | ||
| 26 | |||
| 27 | =back | ||
| 28 | |||
| 29 | =head1 Class Methods | ||
| 30 | |||
| 31 | =head2 new | ||
| 32 | |||
| 33 | C<static method new : L<Sys::Socket::Sockaddr|SPVM::Sys::Socket::Sockaddr> ();> | ||
| 34 | |||
| 35 | Creates a new L<Sys::Socket::Sockaddr|SPVM::Sys::Socket::Sockaddr> object. | ||
| 36 | |||
| 37 | =head2 new_with_family | ||
| 38 | |||
| 39 | C<static method new_with_family : Sys::Socket::Sockaddr ($family : int);> | ||
| 40 | |||
| 41 | Creates a new L<Sys::Socket::Sockaddr::In|SPVM::Sys::Socket::Sockaddr::In> object | ||
| 42 | or a new L<Sys::Socket::Sockaddr::In6|SPVM::Sys::Socket::Sockaddr::In6> object | ||
| 43 | or a new L<Sys::Socket::Sockaddr::In|SPVM::Sys::Socket::Sockaddr::In> object according to the socket family $family, | ||
| 44 | and returns it. | ||
| 45 | |||
| 46 | Excetpions: | ||
| 47 | |||
| 48 | If the address famil is not available, an exception is thrown. | ||
| 49 | |||
| 50 | =head1 Instance Methods | ||
| 51 | |||
| 52 | =head2 sa_family | ||
| 53 | |||
| 54 | C<method sa_family : int ()> | ||
| 55 | |||
| 56 | Returns C<sa_family>. | ||
| 57 | |||
| 58 | =head2 set_sa_family | ||
| 59 | |||
| 60 | C<method sa_family : int ()> | ||
| 61 | |||
| 62 | Sets C<sa_family>. | ||
| 63 | |||
| 64 | =head2 sizeof | ||
| 65 | |||
| 66 | C<method size : int ()> | ||
| 67 | |||
| 68 | Returns the size of the structure. This method is planed to be implemented in a child class. | ||
| 69 | |||
| 70 | Exception: | ||
| 71 | |||
| 72 | Not implemented. | ||
| 73 | |||
| 74 | =head2 clone | ||
| 75 | |||
| 76 | C<method clone : L<Sys::Socket::Sockaddr|SPVM::Sys::Socket::Sockaddr> ();> | ||
| 77 | |||
| 78 | Clones this instance. This method is planed to be implemented in a child class. | ||
| 79 | |||
| 80 | Exception: | ||
| 81 | |||
| 82 | Not implemented. | ||
| 83 | |||
| 84 | =head2 upgrade | ||
| 85 | |||
| 86 | C<method upgrade : Sys::Socket::Sockaddr ();> | ||
| 87 | |||
| 88 | Returns a new L<Sys::Socket::Sockaddr::In|SPVM::Sys::Socket::Sockaddr::In> object, | ||
| 89 | or a new L<Sys::Socket::Sockaddr::In6|SPVM::Sys::Socket::Sockaddr::In6> object, | ||
| 90 | or a new L<Sys::Socket::Sockaddr::Un|SPVM::Sys::Socket::Sockaddr::Un> object | ||
| 91 | according to L</"sa_family">. | ||
| 92 | |||
| 93 | Exceptions: | ||
| 94 | |||
| 95 | If the address family is not available, an exception is thrown. | ||
| 96 | |||
| 97 | =head2 DESTROY | ||
| 98 | |||
| 99 | C<method DESTROY : void ();> | ||
| 100 | |||
| 101 | The destructor. | ||
| 102 | |||
| 103 | =head1 Well Known Child Classes | ||
| 104 | |||
| 105 | =over 2 | ||
| 106 | |||
| 107 | =item L<Sys::Socket::Sockaddr::In|SPVM::Sys::Socket::Sockaddr::In> | ||
| 108 | |||
| 109 | =item L<Sys::Socket::Sockaddr::In6|SPVM::Sys::Socket::Sockaddr::In6> | ||
| 110 | |||
| 111 | =item L<Sys::Socket::Sockaddr::Un|SPVM::Sys::Socket::Sockaddr::Un> | ||
| 112 | |||
| 113 | =item L<Sys::Socket::Sockaddr::Storage|SPVM::Sys::Socket::Sockaddr::Storage> | ||
| 114 | |||
| 115 | =back | ||
| 116 | |||
| 117 | =head1 See Also | ||
| 118 | |||
| 119 | =over 2 | ||
| 120 | |||
| 121 | =item * L<Sys|SPVM::Sys> | ||
| 122 | |||
| 123 | =back | ||
| 124 | |||
| 125 | =head1 Copyright & License | ||
| 126 | |||
| 127 | Copyright (c) 2023 Yuki Kimoto | ||
| 128 | |||
| 129 | MIT License | ||
| 130 |