Liking cljdoc? Tell your friends :D

chromex.app.sockets.tcp-server

clj

Use the chrome.sockets.tcpServer API to create server applications using TCP connections. This API supersedes the TCP functionality previously found in the chrome.socket API.

Use the chrome.sockets.tcpServer API to create server
applications using TCP connections. This API supersedes the TCP functionality
previously found in the chrome.socket API.

  * available since Chrome 36
  * https://developer.chrome.com/apps/sockets.tcpServer
raw docstring

api-tableclj

source

closeclj/smacro

(close socket-id)

Disconnects and destroys the socket. Each socket created should be closed after use. The socket id is no longer valid as soon at the function is called. However, the socket is guaranteed to be closed only when the callback is invoked.

|socket-id| - The socket identifier.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-close.

Disconnects and destroys the socket. Each socket created should be closed after use. The socket id is no longer valid as
soon at the function is called. However, the socket is guaranteed to be closed only when the callback is invoked.

  |socket-id| - The socket identifier.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-close.
sourceraw docstring

close*cljs

(close* config socket-id)
source

createclj/smacro

(create)
(create properties)

Creates a TCP server socket.

|properties| - The socket properties (optional).

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [create-info] where:

|create-info| - The result of the socket creation.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-create.

Creates a TCP server socket.

  |properties| - The socket properties (optional).

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [create-info] where:

  |create-info| - The result of the socket creation.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-create.
sourceraw docstring

create*cljs

(create* config properties)
source

disconnectclj/smacro

(disconnect socket-id)

Disconnects the listening socket, i.e. stops accepting new connections and releases the address/port the socket is bound to. The socket identifier remains valid, e.g. it can be used with listen to accept connections on a new port and address.

|socket-id| - The socket identifier.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-disconnect.

Disconnects the listening socket, i.e. stops accepting new connections and releases the address/port the socket is bound
to. The socket identifier remains valid, e.g. it can be used with listen to accept connections on a new port and address.

  |socket-id| - The socket identifier.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-disconnect.
sourceraw docstring

disconnect*cljs

(disconnect* config socket-id)
source

gen-callclj

source

gen-wrapclj/smacro

(gen-wrap kind item-id config & args)
source

get-infoclj/smacro

(get-info socket-id)

Retrieves the state of the given socket.

|socket-id| - The socket identifier.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [socket-info] where:

|socket-info| - Object containing the socket information.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-getInfo.

Retrieves the state of the given socket.

  |socket-id| - The socket identifier.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [socket-info] where:

  |socket-info| - Object containing the socket information.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-getInfo.
sourceraw docstring

get-info*cljs

(get-info* config socket-id)
source

get-socketsclj/smacro

(get-sockets)

Retrieves the list of currently opened sockets owned by the application.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [socket-infos] where:

|socket-infos| - Array of object containing socket information.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-getSockets.

Retrieves the list of currently opened sockets owned by the application.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [socket-infos] where:

  |socket-infos| - Array of object containing socket information.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-getSockets.
sourceraw docstring

get-sockets*cljs

(get-sockets* config)
source

listenclj/smacro

(listen socket-id address port)
(listen socket-id address port backlog)

Listens for connections on the specified port and address. If the port/address is in use, the callback indicates a failure.

|socket-id| - The socket identifier. |address| - The address of the local machine. |port| - The port of the local machine. When set to 0, a free port is chosen dynamically. The dynamically allocated port can be found by calling getInfo. |backlog| - Length of the socket's listen queue. The default value depends on the Operating System (SOMAXCONN), which ensures a reasonable queue length for most applications.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [result] where:

|result| - The result code returned from the underlying network call. A negative value indicates an error.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-listen.

Listens for connections on the specified port and address. If the port/address is in use, the callback indicates a failure.

  |socket-id| - The socket identifier.
  |address| - The address of the local machine.
  |port| - The port of the local machine. When set to 0, a free port is chosen dynamically. The dynamically allocated
           port can be found by calling getInfo.
  |backlog| - Length of the socket's listen queue. The default value depends on the Operating System (SOMAXCONN), which
              ensures a reasonable queue length for most applications.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [result] where:

  |result| - The result code returned from the underlying network call. A negative value indicates an error.

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-listen.
sourceraw docstring

listen*cljs

(listen* config socket-id address port backlog)
source

on-accept*cljs

(on-accept* config channel & args)
source

on-accept-error*cljs

(on-accept-error* config channel & args)
source

set-pausedclj/smacro

(set-paused socket-id paused)

Enables or disables a listening socket from accepting new connections. When paused, a listening socket accepts new connections until its backlog (see listen function) is full then refuses additional connection requests. onAccept events are raised only when the socket is un-paused.

|socket-id| - https://developer.chrome.com/apps/sockets.tcpServer#property-setPaused-socketId. |paused| - https://developer.chrome.com/apps/sockets.tcpServer#property-setPaused-paused.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-setPaused.

Enables or disables a listening socket from accepting new connections. When paused, a listening socket accepts new
connections until its backlog (see listen function) is full then refuses additional connection requests. onAccept events
are raised only when the socket is un-paused.

  |socket-id| - https://developer.chrome.com/apps/sockets.tcpServer#property-setPaused-socketId.
  |paused| - https://developer.chrome.com/apps/sockets.tcpServer#property-setPaused-paused.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-setPaused.
sourceraw docstring

set-paused*cljs

(set-paused* config socket-id paused)
source

tap-all-eventsclj/smacro

(tap-all-events chan)

Taps all valid non-deprecated events in chromex.app.sockets.tcp-server namespace.

Taps all valid non-deprecated events in chromex.app.sockets.tcp-server namespace.
sourceraw docstring

tap-on-accept-error-eventsclj/smacro

(tap-on-accept-error-events channel & args)

Event raised when a network error occured while the runtime was waiting for new connections on the socket address and port. Once this event is raised, the socket is set to paused and no more onAccept events are raised for this socket until the socket is resumed.

Events will be put on the |channel| with signature [::on-accept-error [info]] where:

|info| - The event data.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/sockets.tcpServer#event-onAcceptError.

Event raised when a network error occured while the runtime was waiting for new connections on the socket address and port.
Once this event is raised, the socket is set to paused and no more onAccept events are raised for this socket until the
socket is resumed.

Events will be put on the |channel| with signature [::on-accept-error [info]] where:

  |info| - The event data.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/sockets.tcpServer#event-onAcceptError.
sourceraw docstring

tap-on-accept-eventsclj/smacro

(tap-on-accept-events channel & args)

Event raised when a connection has been made to the server socket.

Events will be put on the |channel| with signature [::on-accept [info]] where:

|info| - The event data.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/sockets.tcpServer#event-onAccept.

Event raised when a connection has been made to the server socket.

Events will be put on the |channel| with signature [::on-accept [info]] where:

  |info| - The event data.

Note: |args| will be passed as additional parameters into Chrome event's .addListener call.

https://developer.chrome.com/apps/sockets.tcpServer#event-onAccept.
sourceraw docstring

updateclj/smacro

(update socket-id properties)

Updates the socket properties.

|socket-id| - The socket identifier. |properties| - The properties to update.

This function returns a core.async channel of type promise-chan which eventually receives a result value. Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-update.

Updates the socket properties.

  |socket-id| - The socket identifier.
  |properties| - The properties to update.

This function returns a core.async channel of type `promise-chan` which eventually receives a result value.
Signature of the result value put on the channel is [].

In case of an error the channel closes without receiving any value and relevant error object can be obtained via
chromex.error/get-last-error.

https://developer.chrome.com/apps/sockets.tcpServer#method-update.
sourceraw docstring

update*cljs

(update* config socket-id properties)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close