Socket Connected Property problem

  • Thread starter Thread starter TechGladiator
  • Start date Start date
T

TechGladiator

I know that there is a problem with the Connected property in the
sockets in CF. I try to connect to my server app from my CF app and
even thought it is not connected it shows that it is. I know I can
use the SendMessage to send something to the server but If it doesnt
find the server it waits for about 50 secs or so. What I want to do is
implement some kind of timeout using the reg sockets class so if it
doesnt connect in say like 20 secs I can return to the app.

Is there anything I can do? is there anyway to implement timeout with
sockets

Thanks
Mike
 
You will want to use Async. sockets instead of Sync. sockets. Look at the
Beginxxxx methods (BeginConnection, BeginSend, etc.) There are several
class out there that have an implementation already done for Async. sockets
so you might use one of them as a template.

Also, the CF does not support the SetSocketOption for timeout (it supports
it in terms of compile but at runtime you get a unsupported exception.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Async Sockets Buffer Manager / Buffer Pool 1
SSL Socket Connection 1
Moving Router 2
Socket restart issue 4
Socket timeout 4
SSL Connections 2
Socket connect so slow first time? 7
sockets not seeing the world :( 12

Back
Top