TInetServer raises EAccessViolation on connection
Original Reporter info from Mantis: kibook
-
Reporter name:
Original Reporter info from Mantis: kibook
- Reporter name:
Description:
TInetServer from the ssockets unit raises EAccessViolation when it is connected to.
Steps to reproduce:
program Test;
{$mode objfpc}{$H+}
uses
Classes, SysUtils, SSockets;
type
TTestServer = class(TInetServer)
public
procedure StopOnConnect(Sender: TObject; Data: TSocketStream);
end;
procedure TTestServer.StopOnConnect(Sender: TObject; Data: TSocketStream);
begin
Data.Free;
StopAccepting
end;
var
Server: TTestServer;
begin
Server := TTestServer.Create(8888);
Server.OnConnect := @Server.StopOnConnect;
Server.StartAccepting;
Server.Free
end.
Additional information:
On the latest release version (2.6.4) the above example works as expected: the program waits for a connection and terminates cleanly afterwards.
With 2.7.1 (as of SVN revision 27583) it waits for a connection, but when it is connected to it raises the exception before performing the event assigned to
OnConnect.
Mantis conversion info:
- Mantis ID: 26029
- OS: Mac OS X
- OS Build: 10.9
- Build: 27583
- Version: 2.7.1
- Fixed in version: 3.0.0
- Target version: 3.0.0