[lug] Socket Error

Scott A. Herod herod at interact-tv.com
Thu Aug 23 15:47:28 MDT 2001


David wrote:
> 
> >   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.?).

Something on the other side has to be willing to give you the file.
Otherwise, what's to stop me from using a similar mechanism to get
files that are root-read only.  Once a connection is made, however, file
based, socket, or even serial port communication is practically
identical.
( I know java more for this.  I've only used sockets once in C++. )

> >                                      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?

telnet localhost portnumber

for example, 

telnet localhost  6000
Trying 127.0.0.1...
Connected to localhost.localdomain.
Escape character is '^]'.

( 6000 is the X server, the only thing my machine listens to. )

> >   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;

<snipped code>

Hmmm, no guess now.  It all depends on socket:make-socket.

I've got to believe that it's not really opening a socket so shouldn't
be hitting your ipchains rule. Only your error message looks like the
telnet one if I try a non-active port

telnet localhost 80
Trying 127.0.0.1...
telnet: Unable to connect to remote host: Connection refused

Scott



More information about the LUG mailing list