Search
1
vote
closed
"IOError on socket." with 2.4.0.0 Beta

Description

Hello,
I work on ACER F900 with in the InTheHand.Net 2.4.0.0 Beta in c#. I try to send files with OBEX from F900 to my computer. It work fine with files which size is between 1 to 9822 bytes. After 9822 (so 9823 bytes), I got an "IOError on socket." :
Une requête d'envoi ou de réception de données n'a pas été autorisée, car le socket n'est pas connecté et (lors de l'envoi sur un socket datagramme en utilisant un appel sendto) aucune adresse n'a été fournie; ; WidcommRfcommStream_Closed
===> A request to send or receive data was not authorized, because the socket is not connected and (when sending on a datagram socket using a sendto call) no address was supplied; ; WidcommRfcommStream_Closed

à InTheHand.Net.Bluetooth.Widcomm.WidcommRfcommStream.EnsureOpenForWrite()
à InTheHand.Net.Bluetooth.Widcomm.WidcommRfcommStream.BeginWrite(Byte[] buffer, Int32 offset, Int32 count, AsyncCallback callback, Object state)
à InTheHand.Net.Bluetooth.Widcomm.WidcommRfcommStream.Write(Byte[] buffer, Int32 offset, Int32 count)
à InTheHand.Net.Bluetooth.Widcomm.DecoratorNetworkStream.Write(Byte[] buffer, Int32 offset, Int32 count)
à InTheHand.Net.ObexWebRequest.Disconnect()
à InTheHand.Net.ObexWebRequest.GetResponse()
à TestInTheHand.Form1.button1_Click(Object sender, EventArgs e)
à System.Windows.Forms.Control.OnClick(EventArgs e)
à System.Windows.Forms.Button.OnClick(EventArgs e)
à System.Windows.Forms.ButtonBase.WnProc(WM wm, Int32 wParam, Int32 lParam)
à System.Windows.Forms.Control._InternalWnProc(WM wm, Int32 wParam, Int32 lParam)
à Microsoft.AGL.Forms.EVL.EnterMainLoop(IntPtr hwnMain)
à System.Windows.Forms.Application.Run

I use
InTheHand.Net.Personal.dll 2.4.0.0 (from 32feet.NET 2.4_0616_beta)
32feetWidcomm.dll 13 312 bytes (from 32feet.NET 2.4_0616_beta)
VS 2008
the device is Windows Mobile 6 Professional Device
this is the code I use :
private void button1_Click(object sender, EventArgs e)
{
String CurrentDirectory = GetCurrentPath();
String Filename = CurrentDirectory + @"\testfile_{0}.txt";
String NewFilename = String.Empty;
FileStream fs = null;
BinaryWriter bw = null;
Byte[] Buffer;
System.Uri uri = null;
ObexWebRequest request = null;
Cursor.Current = Cursors.WaitCursor;
int Start = int.Parse(TxtStart.Text);
int End = int.Parse(TxtEnd.Text);
int Step = int.Parse(TxtStep.Text);
for (int NbBytes = Start; NbBytes < End; NbBytes += Step)
{
Buffer = new Byte[NbBytes];
StringBuilder sb = new StringBuilder();

NewFilename = sb.AppendFormat(Filename, NbBytes).ToString();
fs = new FileStream(NewFilename, FileMode.Create, FileAccess.ReadWrite);
bw = new BinaryWriter(fs);
bw.Write(Buffer);
bw.Close();
fs.Close();

uri = new Uri("obex://" + "00190E02CFC4" + "/" + Path.GetFileName(NewFilename));
request = new ObexWebRequest(uri);
request.ReadFile(NewFilename);

ObexWebResponse response = (ObexWebResponse)request.GetResponse();
response.Close();
File.Delete(NewFilename);
}
Cursor.Current = Cursors.Default;
}


Thanks !

File Attachments

No files are attached

Closed Dec 1 2010 at 4:24 PM by alanjmcf

Comments

wrote Dec 1 2010 at 4:24 PM
Don't know if you found the solution.  If not, contact us in the forums: http://inthehand.co.uk/forums/default.aspx?GroupID=29

Updating...
© 2006-2012 Microsoft | Get Help | Privacy Statement | Terms of Use | Code of Conduct | Advertise With Us | Version 2012.2.7.18398