Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Mobile Development
  3. Mobile
  4. Connect still works when nothing to connect to

Connect still works when nothing to connect to

Scheduled Pinned Locked Moved Mobile
sysadminhelpquestion
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • H Offline
    H Offline
    hammerstein05
    wrote on last edited by
    #1

    I'm writing a client for a PocketPC 2003 application, connecting to a main application server. If the client is unable to connect to the server, my application should revert to a local data source. connectionSocket = new SocketPacket( ); IPEndPoint remoteEndPoint = new IPEndPoint( IPAddress.Parse( remoteHostIp ), remotePort ); connectionSocket.LocalSocket.Connect( remoteEndPoint ); connectionSocket.LocalSocket.BeginReceive( connectionSocket.DataBuffer, 0, SocketPacket.BufferSize, SocketFlags.None, messageReceivedCallback,connectionSocket ); Reset( ); Reset simply sends a message to the remote machine to reset comms. The problem is, the software thinks the LocalSocket.Connected = true even though it can't be so proceeds as normal. I've put a try.. catch block around this code, but it doesn't fail here it fails further down, trying to send. The Connected property I assume cannot be trusted. Does anyone have a suggested solution for this other than putting in masses of try..catch?

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups