Labs/Jetpack/Binary Components: Difference between revisions

Jump to navigation Jump to search
→‎Memory Profiling Globals: Added documentation for ServerSocket.
(→‎Memory Profiling: added content)
(→‎Memory Profiling Globals: Added documentation for ServerSocket.)
Line 107: Line 107:
Code running in the memory profiling JS runtime has access to the following global objects and functions.
Code running in the memory profiling JS runtime has access to the following global objects and functions.


'''TODO:''' fill this in.
'''ServerSocket'''
 
This constructor creates a new blocking TCP/IP socket with the following methods:
 
::<code>ServerSocket.</code>'''bind'''(''ip'', ''port'')
 
::Binds the socket to the given ''ip'' and ''port''.
 
::<code>ServerSocket.</code>'''listen'''()
 
::Configures the socket for listening.
 
::<code>ServerSocket.</code>'''accept'''()
 
::Blocks until a connection is made on the socket and returns a new <code>ServerSocket</code> object representing the new connection.
 
::<code>ServerSocket.</code>'''recv'''(''size'')
 
::Receives up to ''size'' bytes of text from the connected client and returns it as a string. If the connection has been closed, <code>null</code> is returned instead.
 
::<code>ServerSocket.</code>'''send'''(''text'')
 
::Sends the given text to the connected client.
 
::<code>ServerSocket.</code>'''close'''()
 
::Closes the connection.


== Miscellaneous Functions ==
== Miscellaneous Functions ==
93

edits

Navigation menu