Welcome, Guest. Please login or register.

Author Topic: WaitSelect() with Reaction  (Read 2852 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
WaitSelect() with Reaction
« on: September 20, 2003, 01:57:10 PM »
Heres a message I just posted to the amiga-c mailing list.. hopefully someone here might be able to help me, if the people on the amiga-c ml arent able to...

Quote

> On Mon, 24 Mar 2003, jahc2 wrote:
>
> > I'm having trouble using multiple tasks/processes and msgports,
so
> > now I'm looking into just using one task to handle every thing.
I'm
> > making an internet program with a MUI GUI. How can I make my
program
> > wait until there's information waiting at my socket? I'm thinking
> > WaitSelect() could possibly do the job? I want to wait for
internet
> > activity AND gui stuff at the same time, if thats possible.
>
> Correct, just use WaitSelect() instead of Wait() there... Also
remember
> use sockets in the non-blocking mode. Otherwise your UI gets stuck
very
> easily when sending/receiving data.


I'm using a Reaction GUI in my program now, and it wont process GUI  stuff until data arrives at my socket..

GetAttr(WINDOW_SigMask, window_obj, &signal);

WaitSelect(STDIN, &readfds, NULL, NULL, &tv, &signal);

I dont think "signal" is being signalled when I try to use my GUI. Does anyone here have any Reaction experience?
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: WaitSelect() with Reaction
« Reply #1 on: October 16, 2003, 06:35:22 AM »
How do you setup a socket event mask with SocketBaseTags() ? I'm reading the autodoc but I cant work it out.. sorry!

That sounds like a good way to do it though. Nice and simple to program.

Thanks everyone for your help so far..
 

Offline jahcTopic starter

  • Hero Member
  • *****
  • Join Date: Mar 2002
  • Posts: 521
    • Show all replies
    • http://wookiechat.amigarevolution.com
Re: WaitSelect() with Reaction
« Reply #2 on: November 17, 2003, 03:10:31 AM »
Thanks for your help by email xeron..

My program works well now on my comupter, BUT it wont run on my friends computer.. It looks like the signal isnt getting through somehow..

if( ( socksigbit = AllocSignal( -1 ) ) == - 1 )
{
   printf( "Unable to allocate a signal\n" );
   return FALSE;
}
socket_signal = 1 << socksigbit;

Should the above line be 1L instead of just 1? Does it make a difference?