I am able to send a file using ObexWebRequest to another device. I am trying to use ObexListener to accept the file on the other side, but am not able to do so. To get started I am simply using the DeviceListener sample to receive the files. The problem that I am having is that if I send the file using the ObexWebRequest the connection gets handled by the Windows Mobile built in beam functionality. If I do not use my application to send the file and use the beam filefunctionality on the source device the conection is handled by the DeviceListener sample application. This is the code I am using to send the files.
private void button_send_Click(object sender, EventArgs e)
{
System.Uri uri = new Uri("obex://" + addr + "/" + System.IO.Path.GetFileName(openFileDialog1.FileName));
ObexWebRequest request = new ObexWebRequest(uri);
request.ReadFile(openFileDialog1.FileName);
ObexWebResponse response = (ObexWebResponse)request.GetResponse();
MessageBox.Show(response.StatusCode.ToString());
response.Close();
}
Is there something that I need to do differently when sending the file? or is it something else?