class Server

class Server

lib/net/socket/server.tya:2

Server provides the net/socket/Server standard library API.

Source
# Server provides the net/socket/Server standard library API.
class Server implements Closable
  # Server.handle stores instance state.
  # @type Nil
  handle: nil

  # Server.initialize provides the net/socket/Server standard library operation.
  # @param handle Any handle value.
  # @return Self the initialized object.
  initialize: handle ->
    self.handle = handle

  # Server.accept provides the net/socket/Server standard library operation.
  # @return Any the resulting value.
  accept: ->
    Socket(socket_server_accept(self.handle), false)

  # Server.close provides the net/socket/Server standard library operation.
  # @return Nil the resulting value.
  close: ->
    socket_server_close(self.handle)

  # Server.listen provides the net/socket/Server standard library operation.
  # @param host String host value.
  # @param port Any port value.
  # @param options Dict options value.
  # @return Any the resulting value.
  listen: host, port, options ->
    if options == nil
      options = {}
    Server(socket_server_listen(host, port, options))

  # Server.local_address provides the net/socket/Server standard library operation.
  # @return Any the resulting value.
  local_address: ->
    socket_server_local_address(self.handle)

Instance Variables

handle

Server.handle

lib/net/socket/server.tya:5

Server.handle stores instance state.

Source
  # Server.handle stores instance state.
  # @type Nil
  handle: nil

Methods

accept

Server.accept()

lib/net/socket/server.tya:15

Server.accept provides the net/socket/Server standard library operation.

Source
  # Server.accept provides the net/socket/Server standard library operation.
  # @return Any the resulting value.
  accept: ->
    Socket(socket_server_accept(self.handle), false)

close

Server.close()

lib/net/socket/server.tya:20

Server.close provides the net/socket/Server standard library operation.

Source
  # Server.close provides the net/socket/Server standard library operation.
  # @return Nil the resulting value.
  close: ->
    socket_server_close(self.handle)

initialize

Server.initialize(handle)

lib/net/socket/server.tya:10

Server.initialize provides the net/socket/Server standard library operation.

Source
  # Server.initialize provides the net/socket/Server standard library operation.
  # @param handle Any handle value.
  # @return Self the initialized object.
  initialize: handle ->
    self.handle = handle

listen

Server.listen(host, port, options)

lib/net/socket/server.tya:28

Server.listen provides the net/socket/Server standard library operation.

Source
  # Server.listen provides the net/socket/Server standard library operation.
  # @param host String host value.
  # @param port Any port value.
  # @param options Dict options value.
  # @return Any the resulting value.
  listen: host, port, options ->
    if options == nil
      options = {}
    Server(socket_server_listen(host, port, options))

local_address

Server.local_address()

lib/net/socket/server.tya:35

Server.local_address provides the net/socket/Server standard library operation.

Source
  # Server.local_address provides the net/socket/Server standard library operation.
  # @return Any the resulting value.
  local_address: ->
    socket_server_local_address(self.handle)