Recent

Author Topic: LNet - OnDisconnect Event Not Firing.  (Read 3658 times)

Logic_Bomb

  • New Member
  • *
  • Posts: 41
LNet - OnDisconnect Event Not Firing.
« on: January 07, 2014, 11:46:43 am »
Hey guys,

I have been using LNet for a long while now, and I have never had any issues, but recently I have run into this issue, and it's really been bugging me. The problem is that the LNet OnDisconnect event will not fire server-side when a client disconnects. I have tried re-installing LNet (Numerous different versions), Reinstalling Lazarus (Clean install with old files removed, every version from latest down to 1.0.0) and I have tried building numerous simple applications, using the Object Inspector to set the OnDisconnect callback and also manually setting it with:
Code: [Select]
Server.OnDisconnect:=@OnDisconnect;
All other TCP Connections seem to be working fine, but LNet just refuses to realise that A client has disconnected. OnAccept works and OnRecieve, but not OnDisconnect.

Nothing seems to be working and it's really starting to frustrate me, I don't wish to use Synapse as it adds extra complexity to the application, especially since it works in blocking mode, and Indy is out of the question as it isn't fully compatible.

Tried on platforms:
XP 64-Bit
XP 32-Bit
7 64-Bit
7 32-Bit

Tried Environments:
Laz 1.0.14 - FPC 2.6.2 - Win7-64/Win7-32/XP-64/XP-32
Laz 1.0.8 - Win7-64/Win7-32
...
Laz 1.0.0 - Win7-64/Win7-32/XP-64/XP-32

I'll also verify at this point that this also started happening on my Development machine that hadn't been used in ages, the last time I used it, LNet was working fine, and the problem persists across all 4 Machines and numerous VMs I've tried.

Has anyone else had this problem and can anyone think of a possible solution?

Thanks & Regards,

Logic_
« Last Edit: January 07, 2014, 11:53:29 am by Logic_Bomb »

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11459
  • FPC developer.
Re: LNet - OnDisconnect Event Not Firing.
« Reply #1 on: January 07, 2014, 01:30:13 pm »
Afaik disconnects can take up to the socket timeout which can be easily 10minutes. Did you wait long enough?

Logic_Bomb

  • New Member
  • *
  • Posts: 41
Re: LNet - OnDisconnect Event Not Firing.
« Reply #2 on: January 07, 2014, 02:52:32 pm »
I have never had a TCP disconnect take 10 minutes, especially since the Client is being run on the LocalHost or on a host that is on the same local-area-network. There is no reason I can see for the OnDisconnect Event not to be fired, it has never done this before and has most certainly not taken 10 minutes, this is a sudden, seemingly random occurrence, and nothing I do on any machine seems to fix things.

Is LNet working for yourself?
Just tested on two Linux VMs; Debain & Ubuntu - Same problem persists.
Also just tested OnReceive; this seems to be crashing my application, despite the fact that I have nothing in my OnReceive callback function. This problem persists on new projects on all machines mentioned before.

Regards,

Logic_
« Last Edit: January 07, 2014, 02:54:17 pm by Logic_Bomb »

ttomas

  • Full Member
  • ***
  • Posts: 245
Re: LNet - OnDisconnect Event Not Firing.
« Reply #3 on: January 17, 2014, 03:11:25 pm »
Did OnDisconnect fail some times or never fire?
I detect problem with lnet with stress test.
I detect memory leak, sockets never free and normaly never fire OnDisconnect.
Maybe is the same bug i reported and still open in bug report
http://bugs.freepascal.org/view.php?id=23475

 

TinyPortal © 2005-2018