views:

77

answers:

0

Hello,

We have an issue with Bonjour on Windows. Our requirement is to transfer files from one machine to another with our app which uses Bonjour. While the transfer has been working just fine between Mac to Mac, it doesn't between a Mac and a Windows machine. Please note that there is no issue in the discovery of Windows Machine (which uses Bonjour with Java API)

We suspect the issue could be with the Socket connection. Can somebody throw some light on this as to what could have gone wrong?

Here's a piece of the JAva code used in the program on Windows side.

//this is how a packet is sent.

outSocket.send( new DatagramPacket( sendData, sendData.length, buddyAddr, buddyPort));

//and this is how a packet is received.

class xx extends Thread { public xx( Runnable owner, DatagramSocket s, DatagramPacket p) { fOwner = owner; fSocket = s; fPacket = p; }

public void  run()
{  
 while ( true )
 {
  try 
  {
   fSocket.receive( fPacket);
   SwingUtilities.invokeAndWait( fOwner); // process data on main thread
  }
  catch( Exception e)
  {
   break; // terminate thread
  }
 }
}

protected Runnable   fOwner;
protected DatagramSocket fSocket;
protected DatagramPacket fPacket;

}

We use CFReadStreams to handle streams in the program that runs on a MAC.

Thanks in advance!!