ServerJS/Sockets
From MozillaWiki
< ServerJS
- NSPR Socket Manipulation Functions https://developer.mozilla.org/en/NSPR_API_Reference/I%2f%2fO_Functions#Socket_Manipulation_Functions
- W3 WebSocket interface http://dev.w3.org/html5/spec/Overview.html#network
- v8cgi has a Socket class
- jslibs jsio module This module is based on Netscape Portable Runtime (NSPR) that provides a platform-neutral API for system level and libc like functions. http://code.google.com/p/jslibs/wiki/jsio
- Synchronet provides a Socket class that supports TCP and UDP sockets and provides a fairly complete wrapper for the Berkeley Sockets API: http://synchro.net/docs/jsobjs.html#Socket
- Ejscript provides a Socket class too for TCP and UPP. See: http://www.ejscript.org/products/ejs/doc/api/gen/ejscript/ejs.io-Socket.html
JS.IO http://js.io/ Standalone JavaScript development runtime environment with general purpose native libraries http://code.google.com/p/jslibs/wiki/jsio jsio module Static functions * integer Poll( descriptorArray [, timeout = undefined ] ) * boolean IsReadable( descriptor ) * boolean IsWritable() * integer IntervalNow() * integer UIntervalNow() * Sleep( milliseconds ) * string GetEnv( name ) * string GetRandomNoise( size ) * WaitSemaphore( semaphoreName ) * PostSemaphore( semaphoreName ) * value CreateProcess( path [, argv [, waitExit ]] ) * string hostName * integer physicalMemorySize * Object systemInfo * integer processPriority * string currentWorkingDirectory jsio::Descriptor class * Close() * value Read( amount ) * string Write( data ) * Sync() * available * type * closed Static functions * Import( nativeDescriptor ) Constants * DESC_FILE * DESC_SOCKET_TCP * DESC_SOCKET_UDP * DESC_LAYERED * DESC_PIPE Native Interface * IStreamRead: Read the file as a stream. jsio::Directory class * constructor( directoryName ) Methods * this Open() * Close() * string Read( [, flags = Directory.SKIP_NONE ] ) * Make() * boolean Remove() Properties * exist * name Static functions * Array List( dirName [, flags = Directory.SKIP_DOT] ) Constants * Directory.SKIP_NONE * Directory.SKIP_DOT * Directory.SKIP_DOT_DOT * Directory.SKIP_BOTH * Directory.SKIP_HIDDEN jsio::File class jsio::Descriptor * constructor( fileName ) Methods * this Open( flags [, mode] ) * integer Seek( [ offset = 0 [, whence = File.SEEK_SET ] ] ) * integer Delete() * Lock( state ) * Move( directory ) Properties * integer position * string content * string name * boolean exist * Object info Static properties * File stdin * File stdout * File stderr Constants * Open mode o File.RDONLY o File.WRONLY o File.RDWR o File.CREATE_FILE o File.APPEND o File.TRUNCATE o File.SYNC o File.EXCL * Seek mode o File.SEEK_SET o File.SEEK_CUR o File.SEEK_END * info.type o File.FILE_FILE o File.FILE_DIRECTORY o File.FILE_OTHER Native Interface * IStreamRead: Read the file as a stream. jsio::MemoryMapped class * constructor( file ) Properties * file Native Interface * IBufferGet * constructor( name, size [, mode] ) Methods * Write( data [, offset] ) * string Read( length [, offset] ) * Clear() * Close() Properties * string content Native Interface * IBufferGet jsio::Socket class jsio::Descriptor * constructor( = Socket.TCP ) Methods * Shutdown( [ what ] ) * Bind( port [, ip] ) * Listen( [ backlogSize = 8 ] ) * Socket Accept() * this Connect( host, port [, timeout] ) * string SendTo( host, port, string ) * string RecvFrom() * TransmitFile( fileDescriptor [, close [, headers [, timeout]]] ) Properties * connectContinue * connectionClosed * integer linger * boolean noDelay * boolean reuseAddr * boolean keepAlive * integer recvBufferSize * integer sendBufferSize * integer maxSegment * boolean nonblocking * boolean broadcast * boolean multicastLoopback * string peerName * integer peerPort * string sockName * integer sockPort Static functions * Array GetHostsByName( hostName ) * SendTo ... see Socket::SendTo * RecvFrom ... see Socket::RecvFrom Constants * Socket.TCP * Socket.UDP Native Interface * IStreamRead jsio::IoError class Properties * int os * int code * string text