More Unix I/O work
parent
318f0875a1
commit
47f1c31261
|
@ -23,11 +23,8 @@ $nl
|
|||
"Per-port native I/O protocol:"
|
||||
{ $subsection init-handle }
|
||||
{ $subsection (wait-to-read) }
|
||||
"Additionally, the I/O backend must provide an implementation of the " { $link stream-flush } " and " { $link dispose } " generic words."
|
||||
$nl
|
||||
"Dummy ports which should be used to implement networking:"
|
||||
{ $subsection server-port }
|
||||
{ $subsection datagram-port } ;
|
||||
{ $subsection (wait-to-write) }
|
||||
"Additionally, the I/O backend must provide an implementation of the " { $link dispose } " generic word." ;
|
||||
|
||||
ABOUT: "io.ports"
|
||||
|
||||
|
|
|
@ -73,6 +73,8 @@ M: ssl-handle drain
|
|||
M: ssl ((client)) ( addrspec -- handle )
|
||||
[ addrspec>> ((client)) <ssl-socket> ] with-destructors ;
|
||||
|
||||
M: ssl parse-sockaddr addrspec>> parse-sockaddr ;
|
||||
|
||||
: check-connect-response ( port r -- event )
|
||||
check-response
|
||||
{
|
||||
|
@ -83,10 +85,13 @@ M: ssl ((client)) ( addrspec -- handle )
|
|||
{ SSL_ERROR_SSL [ (ssl-error) ] }
|
||||
} case ;
|
||||
|
||||
: do-ssl-connect ( port ssl -- )
|
||||
: do-ssl-connect ( port ssl addrspec -- )
|
||||
drop
|
||||
2dup SSL_connect check-connect-response dup
|
||||
[ nip wait-for-port ] [ 3drop ] if ;
|
||||
|
||||
M: ssl-handle (wait-to-connect)
|
||||
[ file>> (wait-to-connect) ]
|
||||
[ handle>> do-ssl-connect ] 2bi ;
|
||||
addrspec>>
|
||||
[ >r file>> r> (wait-to-connect) ]
|
||||
[ >r handle>> r> do-ssl-connect ]
|
||||
3bi ;
|
||||
|
|
Loading…
Reference in New Issue