class oppClient
{
int ID;
public void oppClient(_ID)
{
ID=_ID
}
}
private oppClient[] wclOPPClient;
//devices would be "new" in constructor
private void discoverDevices()
{
wclBluetoothRadio Radio = wclBluetoothDiscovery.EnumRadios()[0];
wclBluetoothDiscovery.Discovery(Radio);
}
private void wclBluetoothDiscovery_DiscoveryComplete(object sender, BluetoothDiscoveryCompleteEventArgs e)
{
if (e.Devices != null)
{
for (int i = 0; i < this.wclOPPClient.Count(); i++)
if (!this.wclOPPClient[i].Active)
this.Send(this.Devices,i);
}
}
private void wclOPPClient_Connect(object sender, wclConnectEventArgs e)
{
int ID = ((oppClient)sender).ID;
if (e.Result == 0)
{
this.prgrsBar[ID].situation = 4;
this.wclOPPClient[ID].Put(txtbxFileSubject.Text, this.Stream);
}
}
private void wclOPPClient_Complete(object sender, wclOBEXCompleteEventArgs e)
{
int ID = ((oppClient)sender).ID;
this.prgrsBar[ID].situation = 2;
this.wclOPPClient[ID].Close();
}
discovers,when completed opens the connection (send method), when connected put the object, when completed close the connection.
at first i thought its because of wclClient_Completed event, I thought this event raises exactly before putting is completed so it closes the connection little before it completes. but i found its raised when the putting is completed by testing on sending to my mobile phone device. could you help me?