my problem still not solved!
i create 7 instance it work fine but an hour again not work, and hour again work very fine, ....!
when it is not work with WCL, also windows can not receive file, i test this issue problem with 3-4 system that they have winxp and win7, and with they own bluetooth device.
i change code that can maximum instance create for device, but it is same problem that i say :
List<wclOPPServer> servers = new List<wclOPPServer>();
while (true) {
wclOPPServer morc = new wclOPPServer();
morc.BluetoothParams.Radio = mainBluetoothRadio;
morc.Transport = wclServerTransport.stBluetooth;
if (InitGet(morc)) {
servers.Add(morc);
morCCount++;
}
else {
morc.Dispose();
break;
}
}
public bool InitGet(wclOPPServer wclServer) {
wclServer.OnListen += (object sender, wclConnectEventArgs e) => {
ShowErrorIfDebug(e.Error);
};
wclServer.OnOBEXProgress += (object sender, wclOBEXProgressEventArgs e) => {
if (!address_RecevieID.ContainsKey(wclServer.ObjectName)) {
address_RecevieID.Add(wclServer.ObjectName, Guid.NewGuid());
}
Guid receiveID = address_RecevieID[wclServer.ObjectName];
var value = (byte)((e.Position * 100) / e.Size);
if (OnReceivedProgressChanged != null) {
OnReceivedProgressChanged(this, receiveID, value, wclServer.Address, wclServer.DeviceName);
}
};
wclServer.OnOBEXObjectReceived += (object sender, wclOBEXObjectReceivedEventArgs e) => {
if (OnReceivedFile != null) {
string filePath;
Guid receiveID = address_RecevieID[wclServer.ObjectName];
OnReceivedFile(this, receiveID, e.ObjectName, out filePath, wclServer.Address, wclServer.DeviceName);
if (!String.IsNullOrEmpty(filePath)) {
using (FileStream stream = new FileStream(filePath, FileMode.Create, FileAccess.Write)) {
e.Stream.WriteTo(stream);
}
if (OnFileSaved != null) {
OnFileSaved(this, receiveID, e.ObjectName, filePath, wclServer.Address, wclServer.DeviceName);
}
}
}
};
wclServer.OnConnected += (object sender, EventArgs e) => {
if (BLL.BlackList.Any(q => q.DevieAddress == wclServer.Address)) {
wclServer.Close();
wclServer.Listen();
}
else {
address_RecevieID[wclServer.Address] = Guid.NewGuid();
}
};
int result = wclServer.Listen();
ShowErrorIfDebug(result);
return result == 0;
}