Newsgroups : Borland : borland.public.delphi.internet.winsock : 2005 Nov : Tpersonal(Athread.data).LastPackageTime access violation exception

www.cryer.info
Managed Newsgroup Archive

Tpersonal(Athread.data).LastPackageTime access violation exception

Subject:Tpersonal(Athread.data).LastPackageTime access violation exception
Posted by:"mustafa" (sekendizpa..@yahoo.com)
Date:22 Nov 2005 10:34:16

for example if any client suddenly switch down his computer server program
can not aware this abnormal disconnection.
And ondisconnect event does not occur on TCP server program.
But why can not I access Athread.data value? In which event can I aware that before Athread be unavailable?


Tpersonal = class
Name: String;
.....
LastPackageTime: cardinal;
end;


On my server program I create Tpersonal class for all new connections.( in Tcp server onconnection event )
And I set Athread.data value with this new class.( Athread.data := Tpersonal.create.. )
(Athread:tidpeerthread)


in my connection control timer: this timer controls all connections..

try
for....userlist.count..
   if Gettickcount - Tpersonal(Athread.data).LastPackageTime > 30000
    then removethispersonfromsystem(..)
end..
except //access violation exception
end;

Replies:

www.cryer.info
Managed Newsgroup Archive