Sys/Socket/Errno.pm untested

filter: Statementstmt n/a Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub n/a Podpod n/a SCAR -
1 package SPVM::Sys::Socket::Errno;
2  
3  
4  
5 1;
6  
7 =head1 Name
8  
9 SPVM::Sys::Socket::Errno - Socket Error Numbers
10  
11 =head1 Description
12  
13 Sys::Socket::Errno class in L<SPVM> has methods to get socket error numbers.
14  
15 =head1 Usage
16  
17 use Sys::Socket::Errno;
18
19 my $errno = Sys::Socket::Errno->errno;
20
21 my $strerror = Sys::Socket::Errno->strerror($errno);
22
23  
24 =head1 Class Methods
25  
26 =head2 errno
27  
28 C<static method errno : int ();>
29  
30 Returns C<errno> related to sockets in a portable way.
31  
32 =head2 strerror
33  
34 C<static method strerror : string ($errno : int, $length : int = 0);>
35  
36 Returns C<strerror> related to sockets in a portable way given enough length $max_length to hold the error message..
37  
38 If $length is 0, an appropriate default value is set.
39  
40 =head2 is_read_again
41  
42 C<static method is_read_again : int ($errno : int);>
43  
44 If the error number $errno returned by L</"errno"> method is the return value of L</"EWOULDBLOCK"> or L</"EINTR">, returns 1, otherwise returns 0.
45  
46 =head2 is_write_again
47  
48 C<static method is_write_again : int ($errno : int);>
49  
50 If the error number $errno returned by L</"errno"> method is the return value of L</"EWOULDBLOCK"> or L</"EINTR">, returns 1, otherwise returns 0.
51  
52 =head2 is_connect_again
53  
54 C<static method is_connect_again : int ($errno : int);>
55
56 If the error number $errno returned by L</"errno"> method is the return value of L</"EWOULDBLOCK">, L</"EINPROGRESS"> or L</"EINTR">, returns 1, otherwise returns 0.
57  
58 =head2 is_accept_again
59  
60 C<static method is_accept_again : int ($errno : int);>
61
62 If the error number $errno returned by L</"errno"> method is the return value of L</"EWOULDBLOCK"> or L</"EINTR">, returns 1, otherwise returns 0.
63  
64 =head2 EINTR
65  
66 C<static method EINTR : int ();>
67  
68 Calls L<Errno#WSAEINTR|SPVM::Errno/"WSAEINTR"> method in Windows,
69 or L<Errno#EINTR|SPVM::Errno/"EINTR"> method in other OSs,
70 and returns its return value.
71  
72 =head2 EBADF
73  
74 C<static method EBADF : int ();>
75  
76 Calls L<Errno#WSAEBADF|SPVM::Errno/"WSAEBADF"> method in Windows,
77 or L<Errno#EBADF|SPVM::Errno/"EBADF"> method in other OSs,
78 and returns its return value.
79  
80 =head2 EACCES
81  
82 C<static method EACCES : int ();>
83  
84 Calls L<Errno#WSAEACCES|SPVM::Errno/"WSAEACCES"> method in Windows,
85 or L<Errno#EACCES|SPVM::Errno/"EACCES"> method in other OSs,
86 and returns its return value.
87  
88 =head2 EFAULT
89  
90 C<static method EFAULT : int ();>
91  
92 Calls L<Errno#WSAEFAULT|SPVM::Errno/"WSAEFAULT"> method in Windows,
93 or L<Errno#EFAULT|SPVM::Errno/"EFAULT"> method in other OSs,
94 and returns its return value.
95  
96 =head2 EINVAL
97  
98 C<static method EINVAL : int ();>
99  
100 Calls L<Errno#WSAEINVAL|SPVM::Errno/"WSAEINVAL"> method in Windows,
101 or L<Errno#EINVAL|SPVM::Errno/"EINVAL"> method in other OSs,
102 and returns its return value.
103  
104 =head2 EMFILE
105  
106 C<static method EMFILE : int ();>
107  
108 Calls L<Errno#WSAEMFILE|SPVM::Errno/"WSAEMFILE"> method in Windows,
109 or L<Errno#EMFILE|SPVM::Errno/"EMFILE"> method in other OSs,
110 and returns its return value.
111  
112 =head2 EWOULDBLOCK
113  
114 C<static method EWOULDBLOCK : int ();>
115  
116 Calls L<Errno#WSAEWOULDBLOCK|SPVM::Errno/"WSAEWOULDBLOCK"> method in Windows,
117 or L<Errno#EWOULDBLOCK|SPVM::Errno/"EWOULDBLOCK"> method in other OSs,
118 and returns its return value.
119  
120 =head2 EINPROGRESS
121  
122 C<static method EINPROGRESS : int ();>
123  
124 Calls L<Errno#WSAEINPROGRESS|SPVM::Errno/"WSAEINPROGRESS"> method in Windows,
125 or L<Errno#EINPROGRESS|SPVM::Errno/"EINPROGRESS"> method in other OSs,
126 and returns its return value.
127  
128 =head2 EALREADY
129  
130 C<static method EALREADY : int ();>
131  
132 Calls L<Errno#WSAEALREADY|SPVM::Errno/"WSAEALREADY"> method in Windows,
133 or L<Errno#EALREADY|SPVM::Errno/"EALREADY"> method in other OSs,
134 and returns its return value.
135  
136 =head2 ENOTSOCK
137  
138 C<static method ENOTSOCK : int ();>
139  
140 Calls L<Errno#WSAENOTSOCK|SPVM::Errno/"WSAENOTSOCK"> method in Windows,
141 or L<Errno#ENOTSOCK|SPVM::Errno/"ENOTSOCK"> method in other OSs,
142 and returns its return value.
143  
144 =head2 EDESTADDRREQ
145  
146 C<static method EDESTADDRREQ : int ();>
147  
148 Calls L<Errno#WSAEDESTADDRREQ|SPVM::Errno/"WSAEDESTADDRREQ"> method in Windows,
149 or L<Errno#EDESTADDRREQ|SPVM::Errno/"EDESTADDRREQ"> method in other OSs,
150 and returns its return value.
151  
152 =head2 EMSGSIZE
153  
154 C<static method EMSGSIZE : int ();>
155  
156 Calls L<Errno#WSAEMSGSIZE|SPVM::Errno/"WSAEMSGSIZE"> method in Windows,
157 or L<Errno#EMSGSIZE|SPVM::Errno/"EMSGSIZE"> method in other OSs,
158 and returns its return value.
159  
160 =head2 EPROTOTYPE
161  
162 C<static method EPROTOTYPE : int ();>
163  
164 Calls L<Errno#WSAEPROTOTYPE|SPVM::Errno/"WSAEPROTOTYPE"> method in Windows,
165 or L<Errno#EPROTOTYPE|SPVM::Errno/"EPROTOTYPE"> method in other OSs,
166 and returns its return value.
167  
168 =head2 ENOPROTOOPT
169  
170 C<static method ENOPROTOOPT : int ();>
171  
172 Calls L<Errno#WSAENOPROTOOPT|SPVM::Errno/"WSAENOPROTOOPT"> method in Windows,
173 or L<Errno#ENOPROTOOPT|SPVM::Errno/"ENOPROTOOPT"> method in other OSs,
174 and returns its return value.
175  
176 =head2 EPROTONOSUPPORT
177  
178 C<static method EPROTONOSUPPORT : int ();>
179  
180 Calls L<Errno#WSAEPROTONOSUPPORT|SPVM::Errno/"WSAEPROTONOSUPPORT"> method in Windows,
181 or L<Errno#EPROTONOSUPPORT|SPVM::Errno/"EPROTONOSUPPORT"> method in other OSs,
182 and returns its return value.
183  
184 =head2 ESOCKTNOSUPPORT
185  
186 C<static method ESOCKTNOSUPPORT : int ();>
187  
188 Calls L<Errno#WSAESOCKTNOSUPPORT|SPVM::Errno/"WSAESOCKTNOSUPPORT"> method in Windows,
189 or L<Errno#ESOCKTNOSUPPORT|SPVM::Errno/"ESOCKTNOSUPPORT"> method in other OSs,
190 and returns its return value.
191  
192 =head2 EOPNOTSUPP
193  
194 C<static method EOPNOTSUPP : int ();>
195  
196 Calls L<Errno#WSAEOPNOTSUPP|SPVM::Errno/"WSAEOPNOTSUPP"> method in Windows,
197 or L<Errno#EOPNOTSUPP|SPVM::Errno/"EOPNOTSUPP"> method in other OSs,
198 and returns its return value.
199  
200 =head2 EPFNOSUPPORT
201  
202 C<static method EPFNOSUPPORT : int ();>
203  
204 Calls L<Errno#WSAEPFNOSUPPORT|SPVM::Errno/"WSAEPFNOSUPPORT"> method in Windows,
205 or L<Errno#EPFNOSUPPORT|SPVM::Errno/"EPFNOSUPPORT"> method in other OSs,
206 and returns its return value.
207  
208 =head2 EAFNOSUPPORT
209  
210 C<static method EAFNOSUPPORT : int ();>
211  
212 Calls L<Errno#WSAEAFNOSUPPORT|SPVM::Errno/"WSAEAFNOSUPPORT"> method in Windows,
213 or L<Errno#EAFNOSUPPORT|SPVM::Errno/"EAFNOSUPPORT"> method in other OSs,
214 and returns its return value.
215  
216 =head2 EADDRINUSE
217  
218 C<static method EADDRINUSE : int ();>
219  
220 Calls L<Errno#WSAEADDRINUSE|SPVM::Errno/"WSAEADDRINUSE"> method in Windows,
221 or L<Errno#EADDRINUSE|SPVM::Errno/"EADDRINUSE"> method in other OSs,
222 and returns its return value.
223  
224 =head2 EADDRNOTAVAIL
225  
226 C<static method EADDRNOTAVAIL : int ();>
227  
228 Calls L<Errno#WSAEADDRNOTAVAIL|SPVM::Errno/"WSAEADDRNOTAVAIL"> method in Windows,
229 or L<Errno#EADDRNOTAVAIL|SPVM::Errno/"EADDRNOTAVAIL"> method in other OSs,
230 and returns its return value.
231  
232 =head2 ENETDOWN
233  
234 C<static method ENETDOWN : int ();>
235  
236 Calls L<Errno#WSAENETDOWN|SPVM::Errno/"WSAENETDOWN"> method in Windows,
237 or L<Errno#ENETDOWN|SPVM::Errno/"ENETDOWN"> method in other OSs,
238 and returns its return value.
239  
240 =head2 ENETUNREACH
241  
242 C<static method ENETUNREACH : int ();>
243  
244 Calls L<Errno#WSAENETUNREACH|SPVM::Errno/"WSAENETUNREACH"> method in Windows,
245 or L<Errno#ENETUNREACH|SPVM::Errno/"ENETUNREACH"> method in other OSs,
246 and returns its return value.
247  
248 =head2 ENETRESET
249  
250 C<static method ENETRESET : int ();>
251  
252 Calls L<Errno#WSAENETRESET|SPVM::Errno/"WSAENETRESET"> method in Windows,
253 or L<Errno#ENETRESET|SPVM::Errno/"ENETRESET"> method in other OSs,
254 and returns its return value.
255  
256 =head2 ECONNABORTED
257  
258 C<static method ECONNABORTED : int ();>
259  
260 Calls L<Errno#WSAECONNABORTED|SPVM::Errno/"WSAECONNABORTED"> method in Windows,
261 or L<Errno#ECONNABORTED|SPVM::Errno/"ECONNABORTED"> method in other OSs,
262 and returns its return value.
263  
264 =head2 ECONNRESET
265  
266 C<static method ECONNRESET : int ();>
267  
268 Calls L<Errno#WSAECONNRESET|SPVM::Errno/"WSAECONNRESET"> method in Windows,
269 or L<Errno#ECONNRESET|SPVM::Errno/"ECONNRESET"> method in other OSs,
270 and returns its return value.
271  
272 =head2 ENOBUFS
273  
274 C<static method ENOBUFS : int ();>
275  
276 Calls L<Errno#WSAENOBUFS|SPVM::Errno/"WSAENOBUFS"> method in Windows,
277 or L<Errno#ENOBUFS|SPVM::Errno/"ENOBUFS"> method in other OSs,
278 and returns its return value.
279  
280 =head2 EISCONN
281  
282 C<static method EISCONN : int ();>
283  
284 Calls L<Errno#WSAEISCONN|SPVM::Errno/"WSAEISCONN"> method in Windows,
285 or L<Errno#EISCONN|SPVM::Errno/"EISCONN"> method in other OSs,
286 and returns its return value.
287  
288 =head2 ENOTCONN
289  
290 C<static method ENOTCONN : int ();>
291  
292 Calls L<Errno#WSAENOTCONN|SPVM::Errno/"WSAENOTCONN"> method in Windows,
293 or L<Errno#ENOTCONN|SPVM::Errno/"ENOTCONN"> method in other OSs,
294 and returns its return value.
295  
296 =head2 ESHUTDOWN
297  
298 C<static method ESHUTDOWN : int ();>
299  
300 Calls L<Errno#WSAESHUTDOWN|SPVM::Errno/"WSAESHUTDOWN"> method in Windows,
301 or L<Errno#ESHUTDOWN|SPVM::Errno/"ESHUTDOWN"> method in other OSs,
302 and returns its return value.
303  
304 =head2 ETIMEDOUT
305  
306 C<static method ETIMEDOUT : int ();>
307  
308 Calls L<Errno#WSAETIMEDOUT|SPVM::Errno/"WSAETIMEDOUT"> method in Windows,
309 or L<Errno#ETIMEDOUT|SPVM::Errno/"ETIMEDOUT"> method in other OSs,
310 and returns its return value.
311  
312 =head2 ECONNREFUSED
313  
314 C<static method ECONNREFUSED : int ();>
315  
316 Calls L<Errno#WSAECONNREFUSED|SPVM::Errno/"WSAECONNREFUSED"> method in Windows,
317 or L<Errno#ECONNREFUSED|SPVM::Errno/"ECONNREFUSED"> method in other OSs,
318 and returns its return value.
319  
320 =head2 ELOOP
321  
322 C<static method ELOOP : int ();>
323  
324 Calls L<Errno#WSAELOOP|SPVM::Errno/"WSAELOOP"> method in Windows,
325 or L<Errno#ELOOP|SPVM::Errno/"ELOOP"> method in other OSs,
326 and returns its return value.
327  
328 =head2 ENAMETOOLONG
329  
330 C<static method ENAMETOOLONG : int ();>
331  
332 Calls L<Errno#WSAENAMETOOLONG|SPVM::Errno/"WSAENAMETOOLONG"> method in Windows,
333 or L<Errno#ENAMETOOLONG|SPVM::Errno/"ENAMETOOLONG"> method in other OSs,
334 and returns its return value.
335  
336 =head2 EHOSTDOWN
337  
338 C<static method EHOSTDOWN : int ();>
339  
340 Calls L<Errno#WSAEHOSTDOWN|SPVM::Errno/"WSAEHOSTDOWN"> method in Windows,
341 or L<Errno#EHOSTDOWN|SPVM::Errno/"EHOSTDOWN"> method in other OSs,
342 and returns its return value.
343  
344 =head2 EHOSTUNREACH
345  
346 C<static method EHOSTUNREACH : int ();>
347  
348 Calls L<Errno#WSAEHOSTUNREACH|SPVM::Errno/"WSAEHOSTUNREACH"> method in Windows,
349 or L<Errno#EHOSTUNREACH|SPVM::Errno/"EHOSTUNREACH"> method in other OSs,
350 and returns its return value.
351  
352 =head2 ENOTEMPTY
353  
354 C<static method ENOTEMPTY : int ();>
355  
356 Calls L<Errno#WSAENOTEMPTY|SPVM::Errno/"WSAENOTEMPTY"> method in Windows,
357 or L<Errno#ENOTEMPTY|SPVM::Errno/"ENOTEMPTY"> method in other OSs,
358 and returns its return value.
359  
360 =head2 EUSERS
361  
362 C<static method EUSERS : int ();>
363  
364 Calls L<Errno#WSAEUSERS|SPVM::Errno/"WSAEUSERS"> method in Windows,
365 or L<Errno#EUSERS|SPVM::Errno/"EUSERS"> method in other OSs,
366 and returns its return value.
367  
368 =head2 EDQUOT
369  
370 C<static method EDQUOT : int ();>
371  
372 Calls L<Errno#WSAEDQUOT|SPVM::Errno/"WSAEDQUOT"> method in Windows,
373 or L<Errno#EDQUOT|SPVM::Errno/"EDQUOT"> method in other OSs,
374 and returns its return value.
375  
376 =head2 ESTALE
377  
378 C<static method ESTALE : int ();>
379  
380 Calls L<Errno#WSAESTALE|SPVM::Errno/"WSAESTALE"> method in Windows,
381 or L<Errno#ESTALE|SPVM::Errno/"ESTALE"> method in other OSs,
382 and returns its return value.
383  
384 =head2 EREMOTE
385  
386 C<static method EREMOTE : int ();>
387  
388 Calls L<Errno#WSAEREMOTE|SPVM::Errno/"WSAEREMOTE"> method in Windows,
389 or L<Errno#EREMOTE|SPVM::Errno/"EREMOTE"> method in other OSs,
390 and returns its return value.
391  
392 =head1 See Also
393  
394 =over 2
395  
396 =item * L<Sys|SPVM::Sys>
397  
398 =back
399  
400 =head1 Copyright & License
401  
402 Copyright (c) 2023 Yuki Kimoto
403  
404 MIT License
405