# Welcome to Enlight’s documentation!

## session.py

The session support for Enlight

class `mainCode.session.``enlightSession`(name='', role=0, passcode='')

  The main session class

  String name: | The session name (not needed)
  String role: | The role of the local instance (defaults to HOST, can be HOST or USER)

  `clearAllSessions`()

    Clears all discoverd sessions

  `getSessionId`()

    Get the local session id

  `getSessionMembers`()

    Get all session members :list members: A list of all Session members

  `initConnection`()

    Starts the main dicovery/connction method(s)

  `join`(sessionID)

    Join a remote session

  `leave`()

    Leaves the session, will take at least two seconds

  `lightSearcherDirectMain`()

    The Handler for direct comuncation between HOST and USER

  `lightSearcherMain`()

    The main thread for clients to connect

  `lighthouseMain`()

    The main thread for searching/finding sessions

  `serverMain`()

    Main Discovery server

  `stopSession`()

    Stops the session as a HOST

`mainCode.session.``get_local_ip`(no=0)

  Gets the local ip address

  Int no: | ID of the ip adress

`mainCode.session.``get_random_alphanumeric_string`(length)

  Returns a random alphanumeric string

  Int length: | The length of the output string

`mainCode.session.``testModule`()

  Tests the session server

`mainCode.session.``testOnlyServer`()

  Tests the session server without client

# Indices and tables

- Index
- Module Index
- Search Page