[lug] Socket Error
David
dajo at frii.com
Thu Aug 23 14:35:09 MDT 2001
> Let me see if I understand, you can connect to a remote machine
> with a socket but not a local file?
That is correct. All I want is a byte stream in my code, the language
clearly offers the possibility of connecting to a file on the local
machine using the language's socket mechanism (is that standard in C,
Java, etc.?).
> Is it possible that your function
> call is still trying to make a connection to a socket. Hmmm, but your
> loopback interface should be open according to the ipchains stuff you
> sent, so that's not it. ( Check by telneting to the socket on your
> local machine. )
How do I telnet to "the" socket on my local machine, please?
>
> If it's not that funny language with all the parentheses that you
> like, :-) can you send a bit of the code?
Darn it - it is. But here it is anyway. It is hardly difficult, and
barely informative. All the smarts are in the make-socket function.
I do think that the correct "No such file or directory." message, and
the fact that the message changes when the file exists, taken together
tell us something;
>
> Scott
(defun establish-internet-stream (host port)
(socket:make-socket :type :stream
:format :bivalent
:address-family :internet
:connect :active
:remote-host host
:remote-port port))
(defun establish-file-stream (filename)
(socket:make-socket :type :stream
:format :bivalent
:address-family :file
:connect :active
:remote-filename filename))
<snip>
(with-open-stream
(stream (establish-internet-stream
(uri-host uri)
(or (uri-port uri) 80)))
<snip>
<snip>
(with-open-stream
(stream (establish-file-stream
"/home/dajo/WORK/more/dir/konqueror8Do89a.tmp"))
<snip>
dajo
More information about the LUG
mailing list