A
adiel_g
Environment: vs2005+tcp over usb using activesync 4.2
Application: vs2005 pocket pc application using System.Net.Sockets
Hardware: Ipaq 3850 running pocket pc 2003
I am receiving an error: "An existing connection was forcibly closed by
the remote host" when using system.net.sockets:
Dim ipAddress As IPAddress = ipAddress.Parse(serverIp)
Dim remoteEP As New IPEndPoint(ipAddress, 11000)
' Create a TCP/IP socket.
Dim sender As New Socket(AddressFamily.InterNetwork, _
SocketType.Stream, ProtocolType.Tcp)
' Connect the socket to the remote endpoint.
sender.Connect(remoteEP) '<--connect works fine, no errors
' Encode the data string into a byte array.
Dim msg As Byte() = Encoding.ASCII.GetBytes(strDataToSend & "<EOF>")
' Send the data through the socket.
Dim bytesSent As Integer = sender.Send(msg) '<-- here is the error
line
The error comes at the call to the "sender.Send..." method. If I run
the application from the pocket pc emulator, it works fine. After much
research the problem seems to be related to TCP over USB using
activesync 4.2 but I have yet to find a solution.
Thanks Before Hand,
Adiel
Application: vs2005 pocket pc application using System.Net.Sockets
Hardware: Ipaq 3850 running pocket pc 2003
I am receiving an error: "An existing connection was forcibly closed by
the remote host" when using system.net.sockets:
Dim ipAddress As IPAddress = ipAddress.Parse(serverIp)
Dim remoteEP As New IPEndPoint(ipAddress, 11000)
' Create a TCP/IP socket.
Dim sender As New Socket(AddressFamily.InterNetwork, _
SocketType.Stream, ProtocolType.Tcp)
' Connect the socket to the remote endpoint.
sender.Connect(remoteEP) '<--connect works fine, no errors
' Encode the data string into a byte array.
Dim msg As Byte() = Encoding.ASCII.GetBytes(strDataToSend & "<EOF>")
' Send the data through the socket.
Dim bytesSent As Integer = sender.Send(msg) '<-- here is the error
line
The error comes at the call to the "sender.Send..." method. If I run
the application from the pocket pc emulator, it works fine. After much
research the problem seems to be related to TCP over USB using
activesync 4.2 but I have yet to find a solution.
Thanks Before Hand,
Adiel