[jcifs] cannot write data to a named pipe

Michael B. Allen miallen at eskimo.com
Sun Feb 9 07:07:44 EST 2003


I don't know if that will work over loopback. I seem to recall there
being problems with some CIFS and NetBIOS operations over loopback. Try
connecting to another machine. It does not need to be running the pipe
server to get beyond Connection refused. Connection refused means it
cannot even establish a socket. That doesn't really have much to do
with jCIFS. Try just opening a socket to 127.0.0.1 port 139. Also try
the real hostname or IP. Also try some of the basic jCIFS examples just
to see if anything works at all. Also read this:

  http://jcifs.samba.org/src/docs/pipes.html

Mike


On Sat, 8 Feb 2003 20:06:11 +0100
"Guy De Schepper"@pandora.be wrote:

> Hi,
> 
> I just discovered the existence of jcifs while I was looking for a
> solution to write to and read from a named pipe on a windows platform
> and this from within a java application.
> 
> I wrote a little app to test the basics, but unfortunately, I don't
> succeed in writing any data to my named pipe.
> I always receive a "connection refused" error.
> The exact errorcode = 5002
> After looking in the SmbException class, I found this to be equal to
> ERRioe, but hey, what the hell does that mean ??
> 
> Googling for it didn't give me a clue either, so here is my question:
> 
> Why do I get a "connection refused" error and how can I work around it ?
> 
> this is the code of my app:
> 
> 
> import java.io.*;
> import jcifs.smb.*;
> 
> public class NamedPipeExample {
> 
>  public static void main(String[] args) {
>   try {
>    SmbNamedPipe pipe = new SmbNamedPipe(
> "smb://<my_username>:<my_password>@127.0.0.1/IPC$/pipe/<my_named_pipe>",
> 	   SmbNamedPipe.PIPE_TYPE_RDWR | SmbNamedPipe.PIPE_TYPE_TRANSACT
> );
>    OutputStream out = pipe.getNamedPipeOutputStream();
>    InputStream in = pipe.getNamedPipeInputStream(); 
> 
>    String msg = "some string";
>    out.write( msg.getBytes() );		<== HERE I GET THE ERROR 5002

-- 
A  program should be written to model the concepts of the task it
performs rather than the physical world or a process because this
maximizes  the  potential  for it to be applied to tasks that are
conceptually  similar and, more important, to tasks that have not
yet been conceived. 


More information about the jcifs mailing list