Re: [twsocket] property editor for LineEnd broken in Delphi XE

2011-04-18 Thread Arno Garrels
Arno Garrels wrote:
 Hello Wilfried,
 
 Hi,
 
 I just discovered that the property editor for LineEnd is broken
 using Delphi XE. No big deal for me as I always create TWSocket at
 runtime. I don't know how much work it is. If someone can give some
 hint maybe I find the time to work on it.
 
 Indeed, broken since D2009 and nobody except you noticed it.
 It wasn't registered for the correct string type. I just checked in
 this fix in OverbyteIcsReg.pas:
 
 RegisterPropertyEditor(TypeInfo(AnsiString), TWSocket, 'LineEnd',
TWSocketLineEndProperty);


Additionally I suggest to only allow characters from the ASCII 
range with the property inspector since otherwise the cast to 
AnsiString is a problem.

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


Re: [twsocket] property editor for LineEnd broken in Delphi XE

2011-04-18 Thread Wilfried Mestdagh
Hi Arno,

 It wasn't registered for the correct string type

Yes this fix is working fine.

-- 
mvg, Wilfried
http://www.mestdagh.biz
http://www.comfortsoftware.be
http://www.expertsoftware.be

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


[twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

Hi !

I have a strange problem: in a windows service and using UDP, the service do 
not receive UDP datagram. Trying to debug this problem, I attach Delphi 
debugger to the running service and suddenly it starts receiving the UDP 
datagrams !


Actually the service is a dual mode service/app console and it works 
perfectly well as a console application (and also as a service when a 
debugger is attached).


Any idea bout what could be wrong ? Probably a permission issue. It makes 
use of the default local system account used for services. Tested on Vista 
Ultimate 32 bits.


--
francois.pie...@overbyte.be
The author of the freeware multi-tier middleware MidWare
The author of the freeware Internet Component Suite (ICS)
http://www.overbyte.be

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Arno Garrels
Hello Francois,

 Hi !
 
 I have a strange problem: in a windows service and using UDP, the
 service do not receive UDP datagram. Trying to debug this problem, I
 attach Delphi debugger to the running service and suddenly it starts
 receiving the UDP datagrams !
 
 Actually the service is a dual mode service/app console and it works
 perfectly well as a console application (and also as a service when a
 debugger is attached).
 
 Any idea bout what could be wrong ? Probably a permission issue. It
 makes use of the default local system account used for services.
 Tested on Vista Ultimate 32 bits.

No idea, but that can't be a permission issue IMO. Receiving datagrams
in a service running as system works fine. Also attaching a debugger 
doesn't change security context of the debugee.
What happens is that a new thread is created in the process being
debugged, maybe there's some issue with your multi-threading?

-- 
Arno 


 
 --
 francois.pie...@overbyte.be
 The author of the freeware multi-tier middleware MidWare
 The author of the freeware Internet Component Suite (ICS)
 http://www.overbyte.be
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

No idea, but that can't be a permission issue IMO. Receiving datagrams
in a service running as system works fine. Also attaching a debugger
doesn't change security context of the debugee.
What happens is that a new thread is created in the process being
debugged, maybe there's some issue with your multi-threading?


Maybe, but then why attaching a debugger would make things suddently work ?
I really don't know what to do since attaching a debugger solve the issue. 
This really puzzles me !


The code for the service is the code I already used in other application 
which works fine (using TCP altough).


--
francois.pie...@overbyte.be
http://www.overbyte.be

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Dimitris Botsis

On 18/4/2011 2:34 μμ, Francois PIETTE wrote:

No idea, but that can't be a permission issue IMO. Receiving datagrams
in a service running as system works fine. Also attaching a debugger
doesn't change security context of the debugee.
What happens is that a new thread is created in the process being
debugged, maybe there's some issue with your multi-threading?


Maybe, but then why attaching a debugger would make things suddently work ?
I really don't know what to do since attaching a debugger solve the
issue. This really puzzles me !

The code for the service is the code I already used in other application
which works fine (using TCP altough).



I had a similar experience in the past, not with ICS components but 
generally working on a completely different project.
When project was running normally at some point did not work but when 
attaching a debugger then it would work.
The problem at that situation was that the program needed some time to 
be given for some external operations, so if a debugger was attached or 
a sleep was introduced or a Application.Processmessages command was 
introduced, then it could work.
I don't know if this solves the issue at your situation, but maybe it 
helps. Good luck.

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

Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE
I had a similar experience in the past, not with ICS components but 
generally working on a completely different project.
When project was running normally at some point did not work but when 
attaching a debugger then it would work.
The problem at that situation was that the program needed some time to 
be given for some external operations, so if a debugger was attached or 
a sleep was introduced or a Application.Processmessages command was 
introduced, then it could work.
I don't know if this solves the issue at your situation, but maybe it 
helps. Good luck.


Thanks for suggestion, but I think this doesn't apply in my case.

--
francois.pie...@overbyte.be
http://www.overbyte.be

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Angus Robertson - Magenta Systems Ltd
 *Subject:* Re: [twsocket] UDP receive issue from a Windows service
 The code for the service is the code I already used in other 
 application which works fine (using TCP altough).

I have UDP listen sockets in my ComCap application, running as a service,
sucking in syslogs on port 514 24/7 from my firewalls on three servers,
including 2008 which is the same as Vista.  

I have seen problems sending UDP, probably using a fixed port which I do
sometimes to identify multiple UDP streams from the same server, but am
planning on trying the ReuseAddr feature. 

Angus

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Maurizio Lotauro
Maybe when you use the debugger then the application run undeer a different 
user?

Bye, Maurizio.


This mail has been sent using Alpikom webmail system
http://www.alpikom.it

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Arno Garrels
Maurizio Lotauro wrote:
 Maybe when you use the debugger then the application run undeer a
 different user?

Not when the debugger is attached to a running process.
If the debugger spawns the process to be debugged with CreateProcess
then that might happen.

-- 
Arno Garrels 

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Dimitris Botsis

On 18/4/2011 5:12 μμ, Arno Garrels wrote:

Maurizio Lotauro wrote:

Maybe when you use the debugger then the application run undeer a
different user?


Not when the debugger is attached to a running process.
If the debugger spawns the process to be debugged with CreateProcess
then that might happen.


I think that if you consider what I suggested before, might help you...
It maybe has to do with extra process time the debugger gives
--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be

Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

Maybe when you use the debugger then the application run
undeer a different user?


I start the service which starts sending his UDP datagrams (This is a SNMP 
client) and waiting for UDP response which never comes. Then I attach the 
debugger to the running service process and suddenly the UDP datagrams are 
coming in.



--
francois.pie...@overbyte.be
http://www.overbyte.be

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

I think that if you consider what I suggested before, might help you...
It maybe has to do with extra process time the debugger gives


Thanks for insisting.

Which extra process time do you mean ? The debugger has just to be attached. 
No need to set any breakpoint nor single step. Just attach. IMO, when a 
debugger is attached, the process is not slowed down.


I would also add that there is definetely no CPU time issue, nor network I/O 
issue with the application. Every second, it send a single UDP datagram (A 
SNMP get request) and expect a single UDP datagram (A SNMP get reply). A 
single socket is used for both send and receive and datagram fits in winsock 
receive buffer.


--
francois.pie...@overbyte.be
http://www.overbyte.be

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Dimitris Botsis

On 18/4/2011 5:35 μμ, Francois PIETTE wrote:

I think that if you consider what I suggested before, might help you...
It maybe has to do with extra process time the debugger gives


Thanks for insisting.

Which extra process time do you mean ? The debugger has just to be
attached. No need to set any breakpoint nor single step. Just attach.
IMO, when a debugger is attached, the process is not slowed down.

I would also add that there is definetely no CPU time issue, nor network
I/O issue with the application. Every second, it send a single UDP
datagram (A SNMP get request) and expect a single UDP datagram (A SNMP
get reply). A single socket is used for both send and receive and
datagram fits in winsock receive buffer.

When the debugger is attached is it exactly the same like when it's not 
attached for the program being executed ?

OK then, my idea was that it's different.
Actually I work with some external hardware devices (USB / serial 
connected) that sometimes in the past performed like in the reported 
problem and the solution was to give some more available time to the 
program with Application.ProcessMessages. But when the debugger was 
attached, this solution was not needed and it always worked fine.
Anyway, my approach for the specific problem reported is more generic, 
not dealing at winsock level.

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

Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE
When the debugger is attached is it exactly the same like when it's not 
attached for the program being executed ?


I would say no since my application is working.
But I would say it doesn't change the time required to do domething.


OK then, my idea was that it's different.
Actually I work with some external hardware devices (USB / serial 
connected) that sometimes in the past performed like in the reported 
problem and the solution was to give some more available time to the 
program with Application.ProcessMessages. But when the debugger was 
attached, this solution was not needed and it always worked fine.
Anyway, my approach for the specific problem reported is more generic, 
not dealing at winsock level.


OK, thanks anyway.

--
francois.pie...@overbyte.be
http://www.overbyte.be

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Arno Garrels
Francois PIETTE wrote:
 Maybe when you use the debugger then the application run
 undeer a different user?
 
 I start the service which starts sending his UDP datagrams (This is a
 SNMP client) and waiting for UDP response which never comes. Then I
 attach the debugger to the running service process and suddenly the
 UDP datagrams are coming in.

Sounds like a Microsoft innovation preventing too many bug reports ;)

-- 
Arno Garrels 


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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Arno Garrels
Arno Garrels wrote:
 Francois PIETTE wrote:
 Maybe when you use the debugger then the application run
 undeer a different user?
 
 I start the service which starts sending his UDP datagrams (This is a
 SNMP client) and waiting for UDP response which never comes. Then I
 attach the debugger to the running service process and suddenly the
 UDP datagrams are coming in.
 
 Sounds like a Microsoft innovation preventing too many bug reports ;)

Seriously, what happens if you run the console application as a 
service with my NT Wrapper http://www.duodata.de/ntwrapper/?
If that works I guess the problem can be found in your service code,
assuming that you neither use the Delphi service framework nor
my DDService (http://www.duodata.de/misc/delphi/DDService.zip).

--
Arno Garrels


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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Wilfried Mestdagh
Hi Francois,

 Actually the service is a dual mode service/app console and it works
 perfectly well as a console application (and also as a service when a
 debugger is attached).

I do not understand the 'dual mode' but could that be a reason? What happens
if you put your application into 1 object (no console interaction), then
create/run it in a console application then create/run it in a NT service
application?

-- 
mvg, Wilfried
http://www.mestdagh.biz
http://www.comfortsoftware.be
http://www.expertsoftware.be

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


[twsocket] THttpServer and OnServerStopped

2011-04-18 Thread Miguel Enguica
Hi. I'm trying to build a first application with ICS (latest version), under 
Delphi XE and I'm getting an unexpected behavior. I took WebServer demo as a 
tutorial.

The application works well with OnGetDocument events, but when I get a 
OnPostDocument event, after I perform the return of the values I want, after 30 
seconds I get a OnServerStopped event. I must call Start again to keep the 
server running. Is this normal? What am I doing wrong?

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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Francois PIETTE

Actually the service is a dual mode service/app console and it works
perfectly well as a console application (and also as a service when a
debugger is attached).



I do not understand the 'dual mode' but could that be a reason?


A dual mode service is an application which detect if it run as a service 
application or as a normal console application and take appropriate action 
according to the context. This is very handy for debugging.


What happens if you put your application into 1 object (no console 
interaction), then

create/run it in a console application then create/run it in a NT service
application?


This require a lot of work. I will do if I can't manage to make it work in 
dualmode.


--
francois.pie...@overbyte.be
http://www.overbyte.be


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


Re: [twsocket] UDP receive issue from a Windows service

2011-04-18 Thread Wilfried Mestdagh
Hi Francois,

 A dual mode service is an application which detect if it run as a
 service

I understeand. I did the same concept years ago 

-- 
mvg, Wilfried
http://www.mestdagh.biz
http://www.comfortsoftware.be
http://www.expertsoftware.be

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