Handbook
Glossary
make-sockaddr-outgoing ( addrspec -- sockaddr )
Vocabulary
io
.
sockets
.
private
Inputs
addrspec
an
object
Outputs
sockaddr
an
object
Definition
IN:
io.sockets.private
GENERIC:
make-sockaddr-outgoing
( addrspec -- sockaddr )
Methods
USING:
accessors
alien.c-types
alien.data
io.sockets
io.sockets.private
kernel
sequences
;
M:
ipv4
make-sockaddr-outgoing
[
make-sockaddr-part
]
[
host>>
dup
{
f
"0.0.0.0"
}
member?
[
drop
"127.0.0.1"
]
when
]
[
inet-pton
uint
deref
>>addr
]
tri
;
USING:
accessors
io.sockets
io.sockets.private
kernel
sequences
;
M:
ipv6
make-sockaddr-outgoing
[
make-sockaddr-in6-part
]
[
[
host>>
dup
{
f
"::"
}
member?
[
drop
"::1"
]
when
]
keep
inet-pton
>>addr
]
[
scope-id>>
>>scopeid
]
tri
;
USING:
io.sockets.private
kernel
;
M:
object
make-sockaddr-outgoing
make-sockaddr
;