You will receive only one socket notice for each
NetLibSocketOptionSet(...,netSocketOptSockNotice,...) call. In other words,
the socket clears your notice information after sending the notice. You can
configure the socket to send the next notice, while you are processing the
current notice. Note, that you only register for the notification once, but
you set up the socket every time you need a notice sent.
Since the only implemented notice type is 'Notification', there is a chance
that additional socket activity has occured between the time the socket sent
the notification and the time your application receives the notification.
That means you must be careful to use the notice as a suggestion that the
socket needs attention, and then fully service the socket in response to
each notice.
The original socket notice was a procedural callback, which synchronized the
socket with the socket consumer, and allowed determinant socket services. A
notice via notification is sloppy, but with care, can get the job done.
On 2/28/07, Durgesh Trivedi <[EMAIL PROTECTED]> wrote:
>
> I m developing the client application in which i want the notification
> when their is data in the socket to read
> I m able to read the data only for the first time when the socket is first
> time connected but after that i want to read the socket each time when their
> is data to read (means read every time when the server send me data and
> connection is alive always for that) and go through the palm documentation
> and lots of code i the forum and i found that for that i have to register
> the notification by the use of SysNotifyRegister
>
> here is snap shot of my code and tell me what i m doing wrong so i did get
> the notification i m trying the code of socketnotify example which i get
> from the knw Base
>
>
> #define netTestNotification 'sknt' // what is this i dont understand
>
> static void RegisterNotification()
> {
> UInt16 cardNo;
> LocalID dbID;
>
> if (0 != SysCurAppDatabase(&cardNo, &dbID))
> return; // shouldn't ever fail, but just in case.
>
> SysNotifyRegister(cardNo, dbID, netTestNotification,NULL,
> sysNotifyNormalPriority,0);
>
> }
>
>
> static Err PrimeSocketNotify(OurGlobalsType *gP)
> {
> NetSocketNoticeType notice;
> void *option;
>
> notice.condition = 0xFFFFFFFF; // any event, use more specific
> conditions if needed.
>
> //This is the only eType which is currently support.
> notice.type = netSocketNoticeNotify;
> notice.notice.notify.notifyType =netTestNotification;
> option = ¬ice;
>
>
> return(NetLibSocketOptionSet(AppNetRefnum,socket,netSocketOptLevelSocket,
>
> netSocketOptSockNotice,&option,sizeof(option),AppNetTimeout,&errno));
>
> }
> and the PrimeSocketNotify returning the error value
>
> so pls somebody tell me how do i get the notification for the TCP data
> receive in socket .
> what i m doing wrong in my code
> THanks
> --
> For information on using the ACCESS Developer Forums, or to unsubscribe,
> please see http://www.access-company.com/developers/forums/
>
--
CMRPigs
MRNotPigs
OSMR2Pigs
LILBMRPigs!
Jeff Loucks
--
For information on using the ACCESS Developer Forums, or to unsubscribe, please
see http://www.access-company.com/developers/forums/