Hello.
I have some problem with uploading the data to any device. It's what i'm doing.
I'm sending one file by using Microsoft stack. The receiver is mobile device - Nokia. The first message in mobile phone is something like "Receive data from NAME_OF_SENDER?". When i choose Accept everything is ok. When i choose Reject or i don't make any choose before timeout attained client application stopped by exception:
"An unhandled exception of type 'System.Net.WebException' occurred in InTheHand.Net.Personal.dll
Additional information: Connect failed."
For this example I'm trying to send text file, smaller than 200 bytes.
This is my sending part of code:
InTheHand.Net.BluetoothAddress address;
System.Uri uri;
ObexWebRequest request;
ObexWebResponse response;
for (ushort i = 0; i < clients_indexes.Length; ++i)
{
try {
address = this.clients_array[clients_indexes
].DeviceAddress;
uri = new Uri("obex://" + address.ToString() + "/" + filename);
request = new ObexWebRequest(uri);
request.Timeout = 5000;
request.ReadFile(fullpath);
response = (ObexWebResponse)request.GetResponse();
if (response != null)
response.Close();
}
catch (System.Net.WebException ex)
{
return false;
}
}
I have done some tests with much older version of 32feet (1.6) and this problem doesn't exist. I know, that in InTheHand.Net.Personal.dll is method throwing exception with value "Connect failed". Bot how can I catch it and continue sending file to next devices by using loop from above code? Like you see mine, above method doesn't work.
Thanks for any suggestions and code samples.