socket

Usage:

File /www/vahvarh/teajs.org/examples/docs/modules/socket/require.js does not exist

Launching external process:

File /www/vahvarh/teajs.org/examples/docs/modules/socket/system.js does not exist

Executing bash command with args in array:

File /www/vahvarh/teajs.org/examples/docs/modules/socket/exec3.js does not exist

Executing gzip on file:

File /www/vahvarh/teajs.org/examples/docs/modules/socket/exec3_2.js does not exist

List of static functions

Name Arguments Returns Description
Socket

Int family, Int type, Int proto

or External s, Int family, Int typem Int proto

Socket Socket constructor
getProtoByName

String name

Int
getAddrInfo

String name

Int
getNameInfo

String name

String
getHostName

String name

String
select

Array<Socket> readfds, Array<Socket> writefds, Array<Socket> exceptfds, Int timeval

Int

Allows a program to monitor multiple sockets, waiting until one or more of the file descriptors become "ready" for some class of I/O operation (e.g., input possible). A file descriptor is considered ready if it is possible to perform a corresponding I/O operation (e.g., read(2), or a sufficiently small write(2)) without blocking.

Upon return, each of the file descriptor sets is modified in place to indicate which file descriptors are currently "ready". Thus, if using select() within a loop, the arrays must be reinitialized before each call.

makeNonblock

Int descriptor

Int Returns result of fcntl

List of Socket methods

Name Arguments Returns Description
connect String address Boolean
send String address
or ByteStorage address
+ (Int address, Int port)
Int
receive Int count ByteStorage
receive_strict Int count ByteStorage
bind String address, Int port args.This()
listen Int num args.This()
accept
close
setOption Int name, Int value undefined
getOption Int name Int value
setBlocking Boolean set undefined
getPeerName String