SemysLinkAddConnectionIdentifiedProt

01 Adds an existing connection that received a first handshake message to a link.
02

int32 SemysLinkAddConnectionIdentifiedProt(HSemysLink link, HSemysConn conn, HSemysGatherer gath, SemysConnName const *pConnName, int32 verified);

03 Parameters:
  • link: The link for the connection.
  • conn: The existing connection.
  • gath: The existing gatherer for the connection.
  • pConnName: Name of the connection.
  • verified: True if the connection already is verified.
04 Return Values:
Nonzero if the connection could be added, 0 otherwise.
05 If the connection can be successfully added to the link, it takes over control of the connection and gatherer. The user can drop any associated data about them.
06 This function is used when a server is shared between several links. The user handling the server first has to await the first handshake packet from the other link (which includes the link name) to assign it to the corresponding link.
07 The 'verified' parameter typically is always false (0) because the connection ought to be added to a link the moment it received the first handshake message. A verified connection would require more packet exchanges.
08 Sharing a server for several links imposes some responsability on the user; The user code must:
  • Keep the connection name
  • Create and use a Gatherer for the connection
  • Transmit KeepAlive packets (Zero sized packets) regularly
  • Clean up the connection on any error (loss, gatherer error)
  • Destroy the connection if anything else than the first handshake message (LinkIdentify) is received.
  • Verify the received handshake message and either register the connection at the corresponding link or destroy it.
For reference, see the Group implementation (Core/SemysGroup.c) .
09 Global Lock: Required
Reference: SemysLink.h
Implementation: Semys Library
See Also: Link Sub-System, SemysLinkAddConnectionProt(), SemysLinkAddConnectionNewProt()

Goto: Main Page; This page is part of the Semys software documentation. See About: Documentation for details.