Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (18 sloc) 623 Bytes
;;; Copyright (c) 2006 by Eric Knauel. See file COPYING.
(define (to-ip-address string-or-number)
((string? string-or-number)
(car (host-info:addresses (host-info string-or-number))))
((number? string-or-number)
(error "Can't resolve this" string-or-number))))
(define (open-tcp-connection host port-no)
(let ((sock
(create-socket protocol-family/internet
(to-ip-address host) port-no)))
(connect-socket sock sock-addr)
(values sock (socket:inport sock) (socket:outport sock))))
Jump to Line
Something went wrong with that request. Please try again.