Re: [twsocket] UDP request/response proto

2006-08-18 Thread Arno Garrels
Francois PIETTE wrote:
 Unfortunately the callback requires a window handle as well.
 
 And what is the problem ? Use the TWSocket handle.

Thanks, I must have had a blackout yesterday evening.
The handle of the window used by Windows internally is
passed.

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 
 
 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, August 17, 2006 8:10 PM
 Subject: Re: [twsocket] UDP request/response proto
 
 
 Francois PIETTE wrote:
 What's annoying is that a TTimer creates a window and also
 requires ExtCtrls.pas to be included.
 
 On my site you find a serial comport component (TCiaComPort). It
 has a custom Timer on board that does not create a window, but can
 use an existing window.
 
 Thanks Wilfried, but that doesn't help much since in ICS V6 yuo
 can't use the ICS component window for such purposes.
 Is there any way to create a timer without a window being
 required, I think
 it's not possible. So probably writing a custom timer (which
 requires a window anyway maybe a solution/workaround, if you don't
 want ExtCtrls to be included).
 
 You can use SetTimer API which can either use a message or a
 callback function. So using a callback function will be what you
 need. 
 
 Unfortunately the callback requires a window handle as well.
 
 VOID CALLBACK TimerProc(
HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime
 );
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 
 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-18 Thread Arno Garrels
Angus Robertson - Magenta Systems Ltd wrote:
 Unfortunately the callback requires a window handle as well.
 
 But zero is fine for the handle.  I use this code in a DLL to close
 a database on inactivity.

Thanks Angus, sometimes, especially after a 16 hours day it may
happen that I even forget the meaning of a simple callback, it's high
time to go fishing ;-)  

 
 Angus
 
 procedure TimerProc (Wnd: HWnd; Msg: Integer; Id: Integer;
 CurrentTime: DWord) ; stdcall ;
 begin
SetTimerEnabled (false) ;
doDBClose ;
 end;
 
 procedure SetTimerEnabled (const Value: Boolean);
 begin
   if TimerEnabled = Value then Exit;
   if Value then
   begin
 TimerHandle := SetTimer (0, 0, TimerInterval, @TimerProc) ;
   end
 else
   begin
 if TimerHandle  0 then
  begin
 KillTimer (0, TimerHandle) ;
 TimerHandle := 0 ;
  end;
 end;
   TimerEnabled := Value;
 end;
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Francois Piette
 and unexpected sender? Should I consider a pending
 request as failed or should I just ignore such packets?

Use ReceiveFrom to know from where the packet is comming and throw it away
if you don't like the sender.

 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?

Sorry, I don't understand.

Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
Author of ICS (Internet Component Suite, freeware)
Author of MidWare (Multi-tier framework, freeware)
http://www.overbyte.be

- Original Message - 
From: Arno Garrels [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Thursday, August 17, 2006 10:27 AM
Subject: [twsocket] UDP request/response proto


 Hello,

 I UDP sendto a request datagram to the server,
 when OnDataAvailable triggers I call ReceiveFrom()
 in order to read the response.
 But I think OnDataAvailable is being triggered when
 any datagram addressed to that port arrives, even
 datagrams not sent by the destination server. How
 to handle this situation when some data arrive from
 and unexpected sender? Should I consider a pending
 request as failed or should I just ignore such packets?

 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?

 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html

 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Arno Garrels
Francois Piette wrote:
 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?
 
 Sorry, I don't understand.

Indeed badly expressed, I had the STUN proto in mind when I
wrote it.
In STUN, reliability is accomplished through client 
retransmissions. If no response is received by 1.6
seconds after the last request has been sent, the client SHOULD
consider the transaction to have failed. In other words, requests
would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms,
4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the
transaction to have failed if no response has been received.

I do not know how to write this as an async component method w/o
a timer, but I can write it as a sync method by some wait
function which processes messages and either starts retransmissions
or triggers a final timeout when no response hasbeen received. 

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html

 
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be
 
 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, August 17, 2006 10:27 AM
 Subject: [twsocket] UDP request/response proto
 
 
 Hello,
 
 I UDP sendto a request datagram to the server,
 when OnDataAvailable triggers I call ReceiveFrom()
 in order to read the response.
 But I think OnDataAvailable is being triggered when
 any datagram addressed to that port arrives, even
 datagrams not sent by the destination server. How
 to handle this situation when some data arrive from
 and unexpected sender? Should I consider a pending
 request as failed or should I just ignore such packets?
 
 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Arno Garrels
Francois Piette wrote:
 I do not know how to write this as an async component method w/o
 a timer, but I can write it as a sync method by some wait
 function which processes messages and either starts retransmissions
 or triggers a final timeout when no response hasbeen received.
 
 There is no real differnece in using a TTimer or using
 MsgWaitForMultipleObject. The code you place when
 MsgWaitForMultipleObject return with a timeout is the code you put in
 TTimer event.

What's annoying is that a TTimer creates a window and also requires
ExtCtrls.pas to be included. I also wanted to provide sync as well as
asyc methods.
 
 
 For short times, less than 250 mS, MsgWaitForMultipleObject is better
 than TTimer. The annoying part of MsgWaitForMultipleObject is that
 you have to make a loop and call the message pump. That is really
 annoyng when you don't know what is the message pump, for example in
 a thread. 

Can you please explain why that's a problem.
In a thread, when MsgWaitForMultipleObjects returns due to pending 
message(s) I use Peekmessage() and dispatch them, why isn't it
effective? 

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
  

 TTimer has not this problem. You just let it go, assuming
 the message pump is working somewhere. 
 
 TTimer was a limitation is old Windows version. I think today you can
 have as many timers as you like (to be verifyed in MSDN).
 
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be
 
 
 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, August 17, 2006 12:26 PM
 Subject: Re: [twsocket] UDP request/response proto
 
 
 Francois Piette wrote:
 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?
 
 Sorry, I don't understand.
 
 Indeed badly expressed, I had the STUN proto in mind when I
 wrote it.
 In STUN, reliability is accomplished through client
 retransmissions. If no response is received by 1.6
 seconds after the last request has been sent, the client SHOULD
 consider the transaction to have failed. In other words, requests
 would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms,
 4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the
 transaction to have failed if no response has been received.
 
 I do not know how to write this as an async component method w/o
 a timer, but I can write it as a sync method by some wait
 function which processes messages and either starts retransmissions
 or triggers a final timeout when no response hasbeen received.
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be
 
 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, August 17, 2006 10:27 AM
 Subject: [twsocket] UDP request/response proto
 
 
 Hello,
 
 I UDP sendto a request datagram to the server,
 when OnDataAvailable triggers I call ReceiveFrom()
 in order to read the response.
 But I think OnDataAvailable is being triggered when
 any datagram addressed to that port arrives, even
 datagrams not sent by the destination server. How
 to handle this situation when some data arrive from
 and unexpected sender? Should I consider a pending
 request as failed or should I just ignore such packets?
 
 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
 --
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Francois PIETTE
 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.

You may use Windows API to avoid TTimer and ExtCtrls.

 Can you please explain why that's a problem.
 In a thread, when MsgWaitForMultipleObjects returns due to pending
 message(s) I use Peekmessage() and dispatch them, why isn't it
 effective?

There are message pump which does more than simply get the message and 
dispatch it. And should any exception be raised, then it is no more in the 
same context as - for example the forms unit message pump.

I ended up having an event propagated everywhere so that the component user 
can use his own message pump.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be



- Original Message - 
From: Arno Garrels [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Thursday, August 17, 2006 4:59 PM
Subject: Re: [twsocket] UDP request/response proto


 Francois Piette wrote:
 I do not know how to write this as an async component method w/o
 a timer, but I can write it as a sync method by some wait
 function which processes messages and either starts retransmissions
 or triggers a final timeout when no response hasbeen received.

 There is no real differnece in using a TTimer or using
 MsgWaitForMultipleObject. The code you place when
 MsgWaitForMultipleObject return with a timeout is the code you put in
 TTimer event.

 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included. I also wanted to provide sync as well as
 asyc methods.


 For short times, less than 250 mS, MsgWaitForMultipleObject is better
 than TTimer. The annoying part of MsgWaitForMultipleObject is that
 you have to make a loop and call the message pump. That is really
 annoyng when you don't know what is the message pump, for example in
 a thread.

 Can you please explain why that's a problem.
 In a thread, when MsgWaitForMultipleObjects returns due to pending
 message(s) I use Peekmessage() and dispatch them, why isn't it
 effective?

 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html


 TTimer has not this problem. You just let it go, assuming
 the message pump is working somewhere.

 TTimer was a limitation is old Windows version. I think today you can
 have as many timers as you like (to be verifyed in MSDN).

 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be


 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, August 17, 2006 12:26 PM
 Subject: Re: [twsocket] UDP request/response proto


 Francois Piette wrote:
 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?

 Sorry, I don't understand.

 Indeed badly expressed, I had the STUN proto in mind when I
 wrote it.
 In STUN, reliability is accomplished through client
 retransmissions. If no response is received by 1.6
 seconds after the last request has been sent, the client SHOULD
 consider the transaction to have failed. In other words, requests
 would be sent at times 0ms, 100ms, 300ms, 700ms, 1500ms, 3100ms,
 4700ms, 6300ms, and 7900ms. At 9500ms, the client considers the
 transaction to have failed if no response has been received.

 I do not know how to write this as an async component method w/o
 a timer, but I can write it as a sync method by some wait
 function which processes messages and either starts retransmissions
 or triggers a final timeout when no response hasbeen received.

 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html


 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 Author of ICS (Internet Component Suite, freeware)
 Author of MidWare (Multi-tier framework, freeware)
 http://www.overbyte.be

 - Original Message -
 From: Arno Garrels [EMAIL PROTECTED]
 To: ICS support mailing twsocket@elists.org
 Sent: Thursday, August 17, 2006 10:27 AM
 Subject: [twsocket] UDP request/response proto


 Hello,

 I UDP sendto a request datagram to the server,
 when OnDataAvailable triggers I call ReceiveFrom()
 in order to read the response.
 But I think OnDataAvailable is being triggered when
 any datagram addressed to that port arrives, even
 datagrams not sent by the destination server. How
 to handle this situation when some data arrive from
 and unexpected sender? Should I consider a pending
 request as failed or should I just ignore such packets?

 Also, if I do not use some kind of a wait function
 in order to make a request blocking (like WaitUntilReady),
 it's mandatory to use a timer, correct?

 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng

Re: [twsocket] UDP request/response proto

2006-08-17 Thread Wilfried Mestdagh
Hello Arno,

 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.

On my site you find a serial comport component (TCiaComPort). It has a
custom Timer on board that does not create a window, but can use an
existing window. It does not have to include ExtCtrls.pas or any other
that enlarge console programs. It was on question of one of my users to
include timeouts and still have a small exe.

If you can use it you can copy the code from the unit.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Arno Garrels
Wilfried Mestdagh wrote:
 Hello Arno,
 
 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.
 
 On my site you find a serial comport component (TCiaComPort). It has a
 custom Timer on board that does not create a window, but can use an
 existing window. 

Thanks Wilfried, but that doesn't help much since in ICS V6 yuo can't use
the ICS component window for such purposes.
Is there any way to create a timer without a window being required, I think
it's not possible. So probably writing a custom timer (which requires a
window anyway maybe a solution/workaround, if you don't want ExtCtrls to
be included).

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 It does not have to include ExtCtrls.pas or any other
 that enlarge console programs. It was on question of one of my users
 to include timeouts and still have a small exe.
 
 If you can use it you can copy the code from the unit.
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Francois PIETTE
 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.

 On my site you find a serial comport component (TCiaComPort). It has a
 custom Timer on board that does not create a window, but can use an
 existing window.

 Thanks Wilfried, but that doesn't help much since in ICS V6 yuo can't use
 the ICS component window for such purposes.
 Is there any way to create a timer without a window being required, I 
 think
 it's not possible. So probably writing a custom timer (which requires a
 window anyway maybe a solution/workaround, if you don't want ExtCtrls to
 be included).

You can use SetTimer API which can either use a message or a callback 
function. So using a callback function will be what you need.

--
Contribute to the SSL Effort. Visit http://www.overbyte.be/eng/ssl.html
--
[EMAIL PROTECTED]
http://www.overbyte.be


-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Arno Garrels
Francois PIETTE wrote:
 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.
 
 On my site you find a serial comport component (TCiaComPort). It
 has a custom Timer on board that does not create a window, but can
 use an existing window.
 
 Thanks Wilfried, but that doesn't help much since in ICS V6 yuo
 can't use the ICS component window for such purposes.
 Is there any way to create a timer without a window being required, I
 think
 it's not possible. So probably writing a custom timer (which
 requires a window anyway maybe a solution/workaround, if you don't
 want ExtCtrls to be included).
 
 You can use SetTimer API which can either use a message or a callback
 function. So using a callback function will be what you need.

Unfortunately the callback requires a window handle as well.

VOID CALLBACK TimerProc(
HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime
);

---
Arno Garrels [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html


 
 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Wilfried Mestdagh
Hello Arno,

   I have to check, but I think there is also be an option to create a
   timer without have a window. then it post a message to a message
   queue.

   another option is to create a custom timer using a thread.

---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz

Thursday, August 17, 2006, 19:38, Arno Garrels wrote:

 Wilfried Mestdagh wrote:
 Hello Arno,
 
 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.
 
 On my site you find a serial comport component (TCiaComPort). It has a
 custom Timer on board that does not create a window, but can use an
 existing window. 

 Thanks Wilfried, but that doesn't help much since in ICS V6 yuo can't use
 the ICS component window for such purposes.
 Is there any way to create a timer without a window being required, I think
 it's not possible. So probably writing a custom timer (which requires a
 window anyway maybe a solution/workaround, if you don't want ExtCtrls to
 be included).

 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html


 It does not have to include ExtCtrls.pas or any other
 that enlarge console programs. It was on question of one of my users
 to include timeouts and still have a small exe.
 
 If you can use it you can copy the code from the unit.
 
 ---
 Rgds, Wilfried [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 http://www.mestdagh.biz

-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Francois PIETTE
 Unfortunately the callback requires a window handle as well.

And what is the problem ? Use the TWSocket handle.
--
[EMAIL PROTECTED]
http://www.overbyte.be


- Original Message - 
From: Arno Garrels [EMAIL PROTECTED]
To: ICS support mailing twsocket@elists.org
Sent: Thursday, August 17, 2006 8:10 PM
Subject: Re: [twsocket] UDP request/response proto


 Francois PIETTE wrote:
 What's annoying is that a TTimer creates a window and also requires
 ExtCtrls.pas to be included.
 
 On my site you find a serial comport component (TCiaComPort). It
 has a custom Timer on board that does not create a window, but can
 use an existing window.
 
 Thanks Wilfried, but that doesn't help much since in ICS V6 yuo
 can't use the ICS component window for such purposes.
 Is there any way to create a timer without a window being required, I
 think
 it's not possible. So probably writing a custom timer (which
 requires a window anyway maybe a solution/workaround, if you don't
 want ExtCtrls to be included).
 
 You can use SetTimer API which can either use a message or a callback
 function. So using a callback function will be what you need.
 
 Unfortunately the callback requires a window handle as well.
 
 VOID CALLBACK TimerProc(
HWND hwnd,
UINT uMsg,
UINT_PTR idEvent,
DWORD dwTime
 );
 
 ---
 Arno Garrels [TeamICS]
 http://www.overbyte.be/eng/overbyte/teamics.html
 
 
 
 --
 Contribute to the SSL Effort. Visit
 http://www.overbyte.be/eng/ssl.html --
 [EMAIL PROTECTED]
 http://www.overbyte.be
 -- 
 To unsubscribe or change your settings for TWSocket mailing list
 please goto http://www.elists.org/mailman/listinfo/twsocket
 Visit our website at http://www.overbyte.be
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP request/response proto

2006-08-17 Thread Angus Robertson - Magenta Systems Ltd
 Unfortunately the callback requires a window handle as well.

But zero is fine for the handle.  I use this code in a DLL to close 
a database on inactivity. 

Angus

procedure TimerProc (Wnd: HWnd; Msg: Integer; Id: Integer;

CurrentTime: DWord) ; stdcall ;
begin
   SetTimerEnabled (false) ;
   doDBClose ;
end;

procedure SetTimerEnabled (const Value: Boolean);
begin
if TimerEnabled = Value then Exit;
if Value then
begin
TimerHandle := SetTimer (0, 0, TimerInterval, @TimerProc) ;
end
else
begin
if TimerHandle  0 then
begin
KillTimer (0, TimerHandle) ;
TimerHandle := 0 ;
end;
end;
TimerEnabled := Value;
end;
-- 
To unsubscribe or change your settings for TWSocket mailing list
please goto http://www.elists.org/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be