Re: TcpClient work on emulator but fail in real PocketPC
- From: James OSW <JamesOSW@xxxxxxxxxxxxxxxxxxxxxxxxx>
- Date: Thu, 14 Jul 2005 10:16:03 -0700
Socket programming was working as suggested as I tried a sample code from the
sample code section - Signature Caputure which was using socket instate of
TcpListen and TcpClient. Basically my coding doesn't show any error by the
complier. Just that when I deployed it to the hardware, the application
doesn't seem to work; but it's working 100% perfectly using the emulator.
"Paul G. Tobey [eMVP]" wrote:
> Maybe just recoding the connection in a test program would be a better use
> of your time. Maybe you want to use TcpClient in the real program. We're
> just trying to figure out what's wrong, at this point.
>
> Paul T.
>
> "James OSW" <JamesOSW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> news:2D67EBDD-BE36-40F6-92DE-E34C722323C1@xxxxxxxxxxxxxxxx
> > Basically I had tried a few models of pocket PCs' and I still experince
> > the
> > same problem. I'm currently trying to recode my whole application by using
> > socket.
> >
> >
> > "Alex Yakhnin" wrote:
> >
> >> Also, you can install the excellent tools "vxUtil - is a suite of
> >> network/internet utilities" and try ping the ip address.
> >>
> >> http://www.cam.com/vxutil_pers.html
> >>
> >> -Alex
> >>
> >> --
> >> Alex Yakhnin, .NET CF MVP
> >> www.intelliprog.com
> >> www.opennetcf.org
> >>
> >> "Paul G. Tobey [eMVP]" <ptobey no spam AT no instrument no spam DOT com>
> >> wrote in message news:efhzlv$hFHA.2472@xxxxxxxxxxxxxxxxxxxxxxx
> >> > Try using regular sockets, not TcpClients and bind to the IP address of
> >> > the WiFi adapter. It's possible that a bug (or, at least, I'd call it
> >> > bug), could try to send your traffic over a connection which doesn't
> >> > current exist (ActiveSync, cellular, etc.)
> >> >
> >> > In case this is a bug, we also need the detailed version information
> >> > for
> >> > the device: OS version/WM version, any other version information
> >> > supplied
> >> > by the Control Panel, etc.
> >> >
> >> > Paul T.
> >> >
> >> > "James OSW" <JamesOSW@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
> >> > news:2C455E43-E986-40FE-AC16-783CE301382B@xxxxxxxxxxxxxxxx
> >> >>I was using the IP but not hostname. I had also actually tried both TCP
> >> >>and
> >> >> UDP method. I'll include some part of the coding for better
> >> >> understanding
> >> >> of
> >> >> the situation.
> >> >>
> >> >> Client Side
> >> >>
> >> >> 'Send Message to specific Ip and Port (first send buffer lenght and
> >> >> then
> >> >> the
> >> >> buffer holding message)
> >> >> Public Sub SendMessage(ByVal Ip As String, ByVal Port As Integer,
> >> >> ByVal
> >> >> Message As String)
> >> >> Dim tempclient As System.Net.Sockets.TcpClient
> >> >> Dim Buffer() As Byte =
> >> >> System.Text.Encoding.Default.GetBytes(Message.ToCharArray)
> >> >> If Not checkip(Ip) Then Throw New ArgumentException("Ip is not
> >> >> in
> >> >> the right format")
> >> >> Try
> >> >> tempclient = New System.Net.Sockets.TcpClient
> >> >> tempclient.Connect(Ip, Port)
> >> >> sendBufferLenght(Buffer.Length, tempclient)
> >> >> tempclient.GetStream.Write(Buffer, 0, Buffer.Length)
> >> >> tempclient.Close()
> >> >> Catch
> >> >> tempclient.Close()
> >> >> Throw New Exception("Remote IP is not reachable")
> >> >> End Try
> >> >> End Sub
> >> >>
> >> >> 'Check ip string to be an ip address
> >> >> Private Function checkip(ByVal ip As String) As Boolean
> >> >> Try
> >> >> IPAddress.Parse(ip)
> >> >> Return True
> >> >> Catch ex As Exception
> >> >> Return False
> >> >> End Try
> >> >> End Function
> >> >> End Class
> >> >>
> >> >> 'Send Information
> >> >> Try
> >> >> Client.SendMessage(IP, 6666, Combine)
> >> >> Catch ex As Exception
> >> >> MessageBox.Show(ex.Message, "Error sending message")
> >> >> End Try
> >> >> ==================================================
> >> >>
> >> >> Server Side
> >> >>
> >> >> If (Server Is Nothing) Then
> >> >> 'Retrieve(PORT)
> >> >> Dim PORT As Integer
> >> >> Server = Nothing
> >> >> Server = New AppSignalDetection.ServerClass(6666, True)
> >> >> End If
> >> >>
> >> >> Private Sub OnIncomingMessage(ByVal Args As
> >> >> AppSignalDetection.ServerClass.InMessEvArgs) Handles
> >> >> Server.IncomingMessage
> >> >> 'Get Information
> >> >> msgbox(args.message)
> >> >> End Sub
> >> >> ==================================================
> >> >>
> >> >> Communication between emulator and another seperate PC or locally are
> >> >> working but not with the real device. I was wondering does the
> >> >> application
> >> >> required additional libraries or external components for real
> >> >> hardware?
> >> >>
> >> >> Thanks.
> >> >
> >> >
> >>
> >>
> >>
>
>
>
.
- Follow-Ups:
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Paul G. Tobey [eMVP]
- Re: TcpClient work on emulator but fail in real PocketPC
- References:
- TcpClient work on emulator but fail in real PocketPC
- From: Canon EOS
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Paul G. Tobey [eMVP]
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Canon EOS
- Re: TcpClient work on emulator but fail in real PocketPC
- From: James OSW
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Alex Yakhnin [MVP]
- Re: TcpClient work on emulator but fail in real PocketPC
- From: James OSW
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Paul G. Tobey [eMVP]
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Alex Yakhnin
- Re: TcpClient work on emulator but fail in real PocketPC
- From: James OSW
- Re: TcpClient work on emulator but fail in real PocketPC
- From: Paul G. Tobey [eMVP]
- TcpClient work on emulator but fail in real PocketPC
- Prev by Date: Re: Enumerating configured WiFi network connections
- Next by Date: Re: UShort containing Bits to int, float etc...
- Previous by thread: Re: TcpClient work on emulator but fail in real PocketPC
- Next by thread: Re: TcpClient work on emulator but fail in real PocketPC
- Index(es):
Relevant Pages
|