Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 206539
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:39:19+00:00 2026-05-11T17:39:19+00:00

I’m trying perform a relatively basic TCP socket send/receive operation on Windows CE using

  • 0

I’m trying perform a relatively basic TCP socket send/receive operation on Windows CE using the .NET Compact Framework. I’m trying set the timeout value so that reads/writes on a slow connection timeout instead of blocking forever. On the full framework I’m able to simply set the ReceiveTimeout and SendTimeout properties on the Socket object. Unfortunately, setting these properties on the compact framework immediately results in a SocketException about using an unsupported socket option.

After digging a little further, I came across this page that says the following:

    The following table shows BSD options not supported for setsockopt:

    Value            Type       Description
    SO_ACCEPTCONN    BOOL       Sets socket listening.
    SO_RCVLOWAT      int        Sets recv low watermark.
    SO_RCVTIMEO      int        Sets time-out for recv.
    SO_SNDLOWAT      int        Sets send low watermark.
    SO_SNDTIMEO      int        Sets time-out value for send.
    SO_TYPE          int        Sets socket type.

So it doesn’t look like Windows CE supports timeouts. A timeout will eventually occur on an unresponsive connection but it seems to take about a minute (must be hardcoded somewhere in WinCE). So now I’m trying to figure out how to implement this manually. My first thought is to use asynchronous IO which allows me to WaitOne(timeout). However, this won’t stop the asynchronous thread that will be stuck on EndSend() or EndReceive(). So even if I can timeout my main thread there will still be threads lingering around until the hardcoded timeout is hit. During this time my application won’t shut down properly. The only way I can think of working around this problem would be to abort the asynchronous thread but this seems like a very bad idea and would I like to avoid it.

So what is the correct way to handle this? There must be a simple way since other applications (e.g. IE on WinCE) don’t seem to have any trouble timing out or canceling pending network operations and they seem to be able to shutdown without trouble as well.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-11T17:39:19+00:00Added an answer on May 11, 2026 at 5:39 pm

    I found a clean way to do this. Basically I am doing the sending and receiving in a separate thread and then waiting on an event (manual or auto reset event should work). If the wait times out then simply closing (or disposing) of the socket will cancel the blocking read/write in the other thread causing a graceful (an exception is thrown on the Send()/Receive() call) exit on that thread. Hopefully this will be helpful to someone else…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 119k
  • Answers 119k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer What you want is Microsoft's best practices for composite client… May 11, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer The C++ String Algorithms Library from Boost has pretty much… May 11, 2026 at 11:49 pm
  • Editorial Team
    Editorial Team added an answer Let's assume you want to know how long ago the… May 11, 2026 at 11:49 pm

Related Questions

I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
I am currently running into a problem where an element is coming back from
Seemingly simple, but I cannot find anything relevant on the web. What is the
Does anyone know how can I replace this 2 symbol below from the string
Configuring TinyMCE to allow for tags, based on a customer requirement. My config is

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.