Feature notes: Snif remoting framework (concepts)
inherits from Exception
Root of the snip exception hierarchy. Declared here because every snip unit already builds on this one, so a single handler catches the whole transport.
(no public members)
inherits from EsnipError
The peer sent something the wire format does not allow: a bad header, an over-long length prefix, an unknown field or value kind, or a message kind that does not belong at this point in the exchange.
(no public members)
inherits from EsnipError
The connection object was asked to do something its current state does not allow - connecting one that is already bound, reading a second request while one is pending, or using a connection that is not active.
(no public members)
inherits from EsnipError
The peer closed, or the transport dropped, before the exchange finished.
(no public members)
inherits from EsnipError
A bounded wait ran out with the transport STILL UP: the peer simply said nothing in the time allowed.
DELIBERATELY NOT A LEAF OF EsnipClosed. A timeout is a claim that the connection is alive, so every handler already written to read EsnipClosed as "the peer has gone - drop it, reconnect, fail the session" would draw exactly the opposite conclusion from this one. It sits beside EsnipClosed under the common root instead, where a handler that wants "any transport failure" still catches it through EsnipError and one that wants "the peer is gone" no longer catches it by accident.
(no public members)
IsnipConnection is the transport-agnostic wire abstraction that the Snif/Snic class-remoting framework (see StreamSec.Snif.ClassServer / StreamSec.Snic.ClassClient) uses to move TsnifRequest/TsnifResponse messages over whatever the actual connection is (TLS, SSH, ...). Application code normally never implements this interface directly: it is obtained from an OnGetConnection-style event or from a concrete transport connection (e.g. TsnipClientTLSOctetConnection / TsnipServerTLSOctetConnection in StreamSec.Snip.TLSOctetConnection, or their SSH counterparts) and then just holds/passes it around. The methods below behave differently depending on which side of the connection created them: a client-role connection drives SendRequest/WaitForMessage/ReadResponse in a call-and-wait pattern, while a server-role connection drives ReadRequest/ SendResponse and typically cannot honor WaitForMessage (see the concrete Server* implementations, which raise there).
procedure SetName(const Value: string);
function GetName: string;
function GetHasData: Boolean;
function GetIsActive: Boolean;
function GetConversionKind: TsnifConversionKind;
function ReadRequest(const aRequest: TsnifRequest): Boolean;
function ReadResponse(const aRequest: TsnifResponse): Boolean;
function SendRequest(const aRequest: TsnifRequest): Boolean;
function SendResponse(const aRequest: TsnifResponse): Boolean;
function WaitForMessage: TsnipMessageKind;
function Close: Boolean;
function Equals(Obj: TObject): Boolean;
property IsActive: Boolean read GetIsActive;
property HasData: Boolean read GetHasData;
property Name: string read GetName write SetName;
property ConversionKind: TsnifConversionKind read GetConversionKind;
inherits from TInterfacedObject
implements IsnipConnection
destructor Destroy; override;
function ReadRequest(const aRequest: TsnifRequest): Boolean; virtual; abstract;
function ReadResponse(const aResponse: TsnifResponse): Boolean; virtual; abstract;
function SendRequest(const aRequest: TsnifRequest): Boolean; virtual; abstract;
function SendResponse(const aResponse: TsnifResponse): Boolean; virtual; abstract;
function WaitForMessage: TsnipMessageKind; virtual; abstract;
function Close: Boolean; virtual; abstract;
property IsActive: Boolean read GetIsActive;
property HasData: Boolean read GetHasData;
property Name: string read GetName write SetName;
property ConversionKind: TsnifConversionKind read GetConversionKind;
How a bounded wait for the next inbound frame ended. THREE VALUES RATHER THAN A BOOLEAN, because the two non-arrivals call for opposite answers and a False collapses them. swoTimeout means nothing came within the budget while the transport is still usable - look again, or give up on this read. swoClosed means nothing more can ever come. A caller that turns non-arrival into an exception has to be able to tell them apart, or it reports a dead connection that is in fact alive.