My application halts when WSocketServer is freed, not every time
though. But it happens once in a few times when the application is
closed. Here's the code snippet:
if WSocketServer nil then
begin
WSocketServer.Abort();
Log('Server closed');
FreeAndNil(WSocketServer);
Wilfried ,
Thanks, I am calling ReceiveFrom within OnDataAvailable. When I use
ReceiveFrom my application takes 90% of the cpu and remains in this state.
If i use Receive my aplication works correctly. I presume ReceiveFrom should
not block but in my case it does.
-rvg
- Original
FP There is not much change required. The component is the same, except a
few
FP properties, events and methods required to handle certificate and the
likes.
FP With basic SSL, really small changes are required to turn SSL mode on
and
FP benefit from a crypted communication. If you add
Hello Jack,
Do you have code in OnSessionClosed ? Because it will trigger with the
call to Abort. Set it to nil beforehand. Also this is not called from
within an event of TWSocketServer ?
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
http://www.mestdagh.biz
Hello Jack,
I read your mail better now :) No need for Abort. Just Free the
component. Then OnSessionClose will not fire. What will fire is
OnChangeState, so be aware if you do things there like updating GUI or
so.
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
Hello Francois and everyone else,
We have touched this subject before but the thread never got finished so I'm
afraid it got lost between all of the other postings. I hope you don't mind
that I start this topic in a new thread so I can focus on this single
problem instead of the getting lost in
To summarize : the problem I'm having is that I cannot detect that a
'stream write error' (e.g. due to insufficient disc space) has been
encountered
If your application is downloading large files, it would be much better
to check for sufficient disk space when the header is downloaded
Hi Angus,
Another technique is to save the content yourself in the onDocData event,
leaving RcvdStream set to null, then you can use your own error handling.
Excellent. This is exactly what I was looking for (I did not realize that
leaving RcvdStream set to NULL would allow me to take care
Hello Robert,
I have no idea. Can you try a very simple new project to demonstrate the
behaviour, and also eventually try exacly the same project in D7 ? Just
to be sure it is nothing wrong with Delphi 2005.
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
From your OnSessionAvailable, you call Accept on behalf on the
listening socket. You get the socket handle.
Then you call WSocket_getsockname to get the remote IP/Port.
Thanks, all working now. Also needed WSocket_closesocket to close
connections I want to ignore.
I did look on the
I did look on the 'wiki' page and the old help pages, but none of these
WSocket_xx functions are outlined or documented.
There are still a lot of things missing.
There should be a chapter for the units. WSocket_xx functions are just plain
functions, not component methods. So they belongs to
Hello Wilfried,
Thanks for the quick reply. No, I don't have a OnSessionClose or
OnChangeState handler. Destroying the server object will abort the
socket? Anyway, I also removed Abort() but the problem is still
happening from time to time as before.
--
Best regards,
Jack
Saturday, March 4,
Hello Jack,
I'm checking the log again in your first mail:
main thread ($728):
7c90eb94 + ntdll.dll KiFastSystemCallRet
77d5f3de +0044 user32.dll SendMessageA
71ab8cc3 +489b WS2_32.dll WSACleanup
0048cdc4 +0018 Test.exe
Hello Wilfried,
It looks like it. But it could be SendMessageA called by
WSACleanup, which waits until SendMessageA message is processed.
Maybe this is because the target window and winproc has
been destroyed by TCustomWSocket.Destroy?
--
Best regards,
Jack
Saturday, March 4, 2006, 10:24:04
Hello Jack,
But it could be SendMessageA called by
Yes possible.
Jack can you try to make a simple new project to demonstrate the
behaviour ? I will be glad to try debug in it.
Wich delphi version do you use ?
---
Rgds, Wilfried [TeamICS]
http://www.overbyte.be/eng/overbyte/teamics.html
Hello Wilfried,
It's a little difficult to make a simple project out of it
because the project is kind of complicated already. Maybe I'll
do that when I'm not so busy.
I wonder if you can think of anything that I can hack around
just to see if it'll fix the problem?
--
Best regards,
Jack
16 matches
Mail list logo