public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] bsd sockets question
@ 2005-10-27 17:23 Will Wagner
  2005-10-27 18:49 ` [ECOS] " Grant Edwards
  2005-10-28 15:08 ` [ECOS] " Matt Jerdonek
  0 siblings, 2 replies; 3+ messages in thread
From: Will Wagner @ 2005-10-27 17:23 UTC (permalink / raw)
  To: eCos Discussion

Hi All,

I have a bsd sockets question.

My application has two threads. One thread is waiting on receiving data 
on a socket using the select function, with a timeout of forever.

The other thread calls close on that socket.

I was hoping that upon calling close the select function would return 
with an error. Instead it continues to block. This thread works on linux 
and windows so I was hoping it was standard BSD sockets functionality.

Should this be working or does eCos not support this? If it doesn't 
support it does anyone have any ideas how to implement it, or even where 
to start?

Many thanks,

Will.
-- 
------------------------------------------------------------------------
Will Wagner                                     will_wagner@carallon.com
Senior Project Engineer                        Office Tel: 0207 371 2032
Carallon Ltd, Studio G20, Shepherds Building, Rockley Rd, London W14 0DA
------------------------------------------------------------------------


-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ECOS] Re: bsd sockets question
  2005-10-27 17:23 [ECOS] bsd sockets question Will Wagner
@ 2005-10-27 18:49 ` Grant Edwards
  2005-10-28 15:08 ` [ECOS] " Matt Jerdonek
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2005-10-27 18:49 UTC (permalink / raw)
  To: ecos-discuss

In gmane.os.ecos.general, you wrote:

> My application has two threads. One thread is waiting on
> receiving data on a socket using the select function, with a
> timeout of forever.
>
> The other thread calls close on that socket.
>
> I was hoping that upon calling close the select function would
> return with an error. Instead it continues to block. This
> thread works on linux and windows so I was hoping it was
> standard BSD sockets functionality.
>
> Should this be working or does eCos not support this? If it
> doesn't support it does anyone have any ideas how to implement
> it, or even where to start?

One possible work-around is to call select_with_abort() instead
of select().  Then when you want to shutdown, call close() and
then cyg_select_abort().

-- 
Grant Edwards                   grante             Yow!  Is this ANYWHERE,
                                  at               USA?
                               visi.com            

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] bsd sockets question
  2005-10-27 17:23 [ECOS] bsd sockets question Will Wagner
  2005-10-27 18:49 ` [ECOS] " Grant Edwards
@ 2005-10-28 15:08 ` Matt Jerdonek
  1 sibling, 0 replies; 3+ messages in thread
From: Matt Jerdonek @ 2005-10-28 15:08 UTC (permalink / raw)
  To: Will Wagner, eCos Discussion

One solution is to have the thread that is closing the
socket invoke cyg_thread_release(..) on the thread
that is blocking on the select operation.

-- Matt

--- Will Wagner <will_wagner@carallon.com> wrote:

> Hi All,
> 
> I have a bsd sockets question.
> 
> My application has two threads. One thread is
> waiting on receiving data 
> on a socket using the select function, with a
> timeout of forever.
> 
> The other thread calls close on that socket.
> 
> I was hoping that upon calling close the select
> function would return 
> with an error. Instead it continues to block. This
> thread works on linux 
> and windows so I was hoping it was standard BSD
> sockets functionality.
> 
> Should this be working or does eCos not support
> this? If it doesn't 
> support it does anyone have any ideas how to
> implement it, or even where 
> to start?
> 
> Many thanks,
> 
> Will.
> -- 
>
------------------------------------------------------------------------
> Will Wagner                                    
> will_wagner@carallon.com
> Senior Project Engineer                       
> Office Tel: 0207 371 2032
> Carallon Ltd, Studio G20, Shepherds Building,
> Rockley Rd, London W14 0DA
>
------------------------------------------------------------------------
> 
> 
> -- 
> Before posting, please read the FAQ:
> http://ecos.sourceware.org/fom/ecos
> and search the list archive:
> http://ecos.sourceware.org/ml/ecos-discuss
> 
> 



	
		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-28 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-27 17:23 [ECOS] bsd sockets question Will Wagner
2005-10-27 18:49 ` [ECOS] " Grant Edwards
2005-10-28 15:08 ` [ECOS] " Matt Jerdonek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).