diff --git a/doc/sphinx/_static/sphinx_design.css b/doc/sphinx/_static/sphinx_design.css index a15df5eb80652b3d3afae8723427ff880bc57384..561029a5fa71780a9f292ecb5706e44608ccd019 100644 --- a/doc/sphinx/_static/sphinx_design.css +++ b/doc/sphinx/_static/sphinx_design.css @@ -519,3 +519,43 @@ ul.first.last.simple { .toctree-l1 li { list-style-type: none; } + +table.left-align-column-1 td { + text-align: left +} + +table.left-align-column-2 td + td { + text-align: left +} + + +table.left-align-column-3 td + td + td { + text-align: left +} + + +table.left-align-column-4 td + td + td + td { + text-align: left +} + + +table.right-align-column-1 td { + text-align: right +} + +table.right-align-column-2 td + td { + text-align: right +} + +table.right-align-column-3 td + td + td { + text-align: right +} + +table.right-align-column-4 td + td + td +td { + text-align: right +} + + + + + diff --git a/doc/sphinx/book/app/d_plugins.rst b/doc/sphinx/book/app/d_plugins.rst index 6b2bd45089e876368be0bd9f4f1e352511d9361f..87be87f9892d68744e1e4aad6b56bba54d3ac4f4 100644 --- a/doc/sphinx/book/app/d_plugins.rst +++ b/doc/sphinx/book/app/d_plugins.rst @@ -504,8 +504,10 @@ Example, creating a function which sets each option in a separate line: > local p = {} > p.host = 'widgets.com' > p.db = 'test' + > p.user = 'postgres' + > p.password = 'postgres' > local conn = pg.connect(p) - > return p + > return conn > end --- ... @@ -557,9 +559,9 @@ in the SQL statement. tarantool> conn:execute('select tablename from pg_tables') --- - - - table_name: ALL_PLUGINS - - table_name: pg_statistics - - table_name: pg_type + - - tablename: pg_statistic + - tablename: pg_type + - tablename: pg_authid <...> ... @@ -609,7 +611,7 @@ on /usr. The PostgreSQL server is already running on the local host 127.0.0.1. $ # them in all places. Insert a row in database postgres, and quit. $ psql -h 127.0.0.1 -p 5432 -U postgres -d postgres Password for user postgres: - psql (9.3.0, server 9.3.2) + psql (9.3.10) SSL connection (cipher: DHE-RSA-AES256-SHA, bits: 256) Type "help" for help. @@ -654,15 +656,15 @@ on /usr. The PostgreSQL server is already running on the local host 127.0.0.1. $ # Change directory to a directory which can be used for $ # temporary tests. For this example we assume that the - $ # name of this directory is /home/pgulutzan/tarantool_sandbox. - $ # (Change "/home/pgulutzan" to whatever is the user's actual + $ # name of this directory is $HOME/tarantool_sandbox. + $ # (Change "$HOME" to whatever is the user's actual $ # home directory for the machine that's used for this test.) - cd /home/pgulutzan/tarantool_sandbox + cd $HOME/tarantool_sandbox $ # Start the Tarantool server. Do not use a Lua initialization file. $ tarantool - tarantool: version 1.6.6-222-g48b98bb + tarantool: version 1.6.8-412-g803b15c type 'help' for interactive help tarantool> @@ -688,9 +690,9 @@ Lua tutorial earlier in the Tarantool user manual. tarantool> function pg_select () > local conn = pg.connect({ > host = '127.0.0.1', - > port = 5432 - > user = 'postgres' - > password = 'postgres' + > port = 5432, + > user = 'postgres', + > password = 'postgres', > db = 'postgres' > }) > local test = conn:execute('SELECT * FROM test WHERE s1 = 1') diff --git a/doc/sphinx/book/box/atomic.rst b/doc/sphinx/book/box/atomic.rst index cadea351d5d3c7151a4d92bc08b535eeb50f6f48..bfa4bdcc235c4d9b741b4e9acae3dd7dbd47356f 100644 --- a/doc/sphinx/book/box/atomic.rst +++ b/doc/sphinx/book/box/atomic.rst @@ -1,3 +1,5 @@ +.. _atomic_execution: + ------------------------------------------------------------------------------- Atomic execution ------------------------------------------------------------------------------- @@ -6,38 +8,51 @@ In several places in this manual it's been noted that Lua processes occur in fib single thread. That is why there can be a guarantee of execution atomicity. That requires emphasis. + +.. _cooperative_multitasking: + =========================================================== Cooperative multitasking environment =========================================================== -Tarantool uses cooperative multi-tasking: unless a -running fiber deliberately yields control to some other fiber, it is not -preempted. “Yield points†are built into all calls from Tarantool core to the -operating system. Any system call which can block is performed in an -asynchronous manner and the fiber waiting on the system call is preempted with -a fiber ready to run. This model makes all programmatic locks unnecessary: +Tarantool uses cooperative multitasking: unless a +running fiber deliberately yields control, it is not +preempted by some other fiber. +But a running fiber will deliberately yield when it encounters a +"yield point": an explicit yield() request, or an implicit +yield due to an operating-system call. +Any system call which can block will be performed asynchronously, +and any running fiber which must wait for a system call will be +preempted so that another ready-to-run fiber takes its place and +becomes the new running fiber. +This model makes all programmatic locks unnecessary: cooperative multitasking ensures that there will be no concurrency around a resource, -no race conditions and no memory consistency issues. +no race conditions, and no memory consistency issues. -When requests are small, e.g. simple UPDATE, INSERT, DELETE, SELECT, fiber +When requests are small, for example simple UPDATE or INSERT or DELETE or SELECT, fiber scheduling is fair: it takes only a little time to process the request, schedule a disk write, and yield to a fiber serving the next client. -A function, however, can perform complex computations, or be written in such a -way that control is not given away for a long time. This can lead to unfair +However, a function might perform complex computations or might be written in such a +way that yields do not occur for a long time. This can lead to unfair scheduling, when a single client throttles the rest of the system, or to apparent stalls in request processing. Avoiding this situation is the -responsibility of the function's author. Most of the box calls, such as -:func:`box.space...insert <space_object.insert>`, -:func:`box.space...update <space_object.update>`, -:func:`box.space...delete <space_object.delete>` are yield points; +responsibility of the function's author. For the default memtx storage engine +most of the box calls, including the data-change requests +:func:`box.space...insert <space_object.insert>` or +:func:`box.space...update <space_object.update>` or +:func:`box.space...delete <space_object.delete>`, are yield points; however, :func:`box.space...select <space_object.select>` is not. -It should also be noted that, in the absence of transactions, any yield in a -function is a potential change in the database state. Effectively, it's only -possible to have CAS (compare-and-swap) -like atomic stored procedures: i.e. -functions which select and then modify a record. Multiple data change requests -always run through a built-in yield point. +Note re storage engine: sophia has different rules: +insert or update or delete will very rarely cause a yield, +but select can cause a yield. + +In the absence of transactions, any function that contains yield points +may see changes in the database state caused by fibers that preempt. +Then the only safe atomic functions for memtx databases would be +functions which contain only one database request, or functions which +contain a select request followed by a data-change request. At this point an objection could arise: "It's good that a single data-change request will commit and yield, but surely there are times when multiple @@ -49,19 +64,19 @@ block was designed. .. function:: box.begin() - From this point, implicit yields are suspended. In effect the fiber which - executes ``box.begin()`` is starting an "active multi-request transaction", - blocking all other fibers until the transaction ends. All operations within - this transaction should use the same storage engine. + Begin the transaction. Disable implicit yields until the transaction ends. + Signal that writes to the write-ahead log will be deferred until the transaction ends. + In effect the fiber which executes ``box.begin()`` is starting an "active + multi-request transaction", blocking all other fibers. .. function:: box.commit() - End the currently active transaction, and make all its data-change + End the transaction, and make all its data-change operations permanent. .. function:: box.rollback() - End the currently active transaction, but cancel all its data-change + End the transaction, but cancel all its data-change operations. An explicit call to functions outside ``box.space`` that always yield, such as ``fiber.yield`` or ``fiber.sleep``, will have the same effect. @@ -70,6 +85,11 @@ It is not enough to enclose them between ``begin`` and ``commit`` or ``rollback` To ensure they are sent as a single block: put them in a function, or put them all on one line, or use a delimiter so that multi-line requests are handled together. +**All database operations in a transaction should use the same storage engine**. +It is not safe to access tuple sets that are defined with {engine='sophia'} +and also access tuple sets that are defined with {engine='memtx'}, +in the same transaction. + =========================================================== Example =========================================================== diff --git a/doc/sphinx/book/box/authentication.rst b/doc/sphinx/book/box/authentication.rst index eaf292017e35fabd7347f340c21f3706837b4621..a52cdad10b5a57d515a0b22d854086ff0a97610d 100644 --- a/doc/sphinx/book/box/authentication.rst +++ b/doc/sphinx/book/box/authentication.rst @@ -65,6 +65,11 @@ There are four special tuples in the _user space: 'guest', 'admin', 'public', an .. container:: table + .. rst-class:: left-align-column-1 + .. rst-class:: right-align-column-2 + .. rst-class:: left-align-column-3 + .. rst-class:: left-align-column-4 + +-------------+----+------+--------------------------------------------------------+ | Name | ID | Type | Description | +=============+====+======+========================================================+ diff --git a/doc/sphinx/book/box/box_index.rst b/doc/sphinx/book/box/box_index.rst index 07b3c851bd6e239278b445a68bfe9eb5648073fc..fc2dd55b50847a61c6420858150077fc0e4c6614 100644 --- a/doc/sphinx/book/box/box_index.rst +++ b/doc/sphinx/book/box/box_index.rst @@ -115,6 +115,10 @@ API is a direct binding to corresponding methods of index objects of type Note re storage engine: sophia does not allow search-value-parts to be ``nil`` or missing. + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + .. rst-class:: left-align-column-3 + +---------------+-----------+---------------------------------------------+ | Type | Arguments | Description | +===============+===========+=============================================+ @@ -166,6 +170,10 @@ API is a direct binding to corresponding methods of index objects of type **Iterator types for HASH indexes** + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + .. rst-class:: left-align-column-3 + +---------------+-----------+------------------------------------------------+ | Type | Arguments | Description | +===============+===========+================================================+ @@ -195,6 +203,10 @@ API is a direct binding to corresponding methods of index objects of type **Iterator types for BITSET indexes** + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + .. rst-class:: left-align-column-3 + +----------------------------+-----------+----------------------------------------------+ | Type | Arguments | Description | +============================+===========+==============================================+ @@ -227,6 +239,10 @@ API is a direct binding to corresponding methods of index objects of type **Iterator types for RTREE indexes** + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + .. rst-class:: left-align-column-3 + +--------------------+-----------+---------------------------------------------------------+ | Type | Arguments | Description | +====================+===========+=========================================================+ diff --git a/doc/sphinx/book/box/box_schema.rst b/doc/sphinx/book/box/box_schema.rst index 87a8c291ee4bcef8b3f6a499e4e3f996dc6e9431..7c2bde3e37ad5128b3c2b09507a93b2a2aca4cdb 100644 --- a/doc/sphinx/book/box/box_schema.rst +++ b/doc/sphinx/book/box/box_schema.rst @@ -25,6 +25,11 @@ for spaces, users, roles, and function tuples. **Options for box.schema.space.create** + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + .. rst-class:: left-align-column-3 + .. rst-class:: left-align-column-4 + +---------------+--------------------+---------+---------------------+ | Name | Effect | Type | Default | +===============+====================+=========+=====================+ @@ -102,19 +107,21 @@ available for insert, select, and all the other :mod:`box.space` functions. box.schema.user.create('Lena', {password = 'X'}) box.schema.user.create('Lena', {if_not_exists = false}) -.. function:: box.schema.user.drop(user-name) +.. function:: box.schema.user.drop(user-name [, {options} ]) Drop a user. For explanation of how Tarantool maintains user data, see section :ref:`Users and the _user space <authentication-users>`. :param string user-name: the name of the user + :param table options: if_exists **Example:** .. code-block:: lua box.schema.user.drop('Lena') + box.schema.user.drop('Lena',{if_exists=false}) .. function:: box.schema.user.exists(user-name) diff --git a/doc/sphinx/book/box/box_space.rst b/doc/sphinx/book/box/box_space.rst index f268efe106a512239332146500989f18cdc6664e..f6c11978103a55d007eaa6c491fb87f17d4aaecb 100644 --- a/doc/sphinx/book/box/box_space.rst +++ b/doc/sphinx/book/box/box_space.rst @@ -63,6 +63,11 @@ A list of all ``box.space`` functions follows, then comes a list of all Options for ``space_object:create_index``: + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + .. rst-class:: left-align-column-3 + .. rst-class:: left-align-column-4 + +---------------+--------------------+-----------------------------+---------------------+ | Name | Effect | Type | Default | +===============+====================+=============================+=====================+ diff --git a/doc/sphinx/book/box/index.rst b/doc/sphinx/book/box/index.rst index c4dde6d29ce399e834adf1ecb055a0bd23b6bdb8..020c3a52f845b512ace7bb07c2c83f1e10dd21a6 100644 --- a/doc/sphinx/book/box/index.rst +++ b/doc/sphinx/book/box/index.rst @@ -325,6 +325,8 @@ because after the UPDATE the transaction processor thread can switch to another fiber, and delete the tuple that was just updated. Note re storage engine: sophia handles yields differently, see :ref:`differences between memtx and sophia <sophia_diff>`. +Note re multi-request transactions: there is a way to delay yields, +see :ref:`Atomic execution <atomic_execution>`. Since locks don't exist, and disk writes only involve the write-ahead log, transactions are usually fast. Also the Tarantool server may not be using @@ -540,6 +542,9 @@ introspection (inspecting contents of spaces, accessing server configuration). **Complexity Factors that may affect data manipulation functions in the box library** + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + +-------------------+-----------------------------------------------------+ | Index size | The number of index keys is the same as the number | | | of tuples in the data set. For a TREE index, if | diff --git a/doc/sphinx/book/box/sophia_diff.rst b/doc/sphinx/book/box/sophia_diff.rst index 9bac36dd7f44230e8d542aee15c5dbd48fc0e4cb..924ef45d3b52a51d3d57c3a7a955d90f98b1cd8a 100644 --- a/doc/sphinx/book/box/sophia_diff.rst +++ b/doc/sphinx/book/box/sophia_diff.rst @@ -55,7 +55,7 @@ It was explained :ref:`earlier <yields_must_happen>` that memtx does not "yield" on a select request, it yields only on data-change requests. However, sophia does yield on a select request, or on an equivalent such as get() or pairs(). This has significance - for cooperative multitasking. + for :ref:`cooperative multitasking <cooperative_multitasking>`. For more about sophia, see Appendix E :ref:`sophia <sophia>`. diff --git a/doc/sphinx/book/configuration/index.rst b/doc/sphinx/book/configuration/index.rst index 86665f903d6ac37d6a5d5be04b9c668c8923e90b..fcde70dcf5d58ac8333a487ed722b547c56cf782 100644 --- a/doc/sphinx/book/configuration/index.rst +++ b/doc/sphinx/book/configuration/index.rst @@ -87,6 +87,9 @@ If username:password is omitted, then 'guest' is assumed. Some examples: .. container:: table + .. rst-class:: left-align-column-1 + .. rst-class:: left-align-column-2 + +-----------------------------+------------------------------+ | URI fragment | Example | +=============================+==============================+ diff --git a/doc/sphinx/book/connectors/__c.rst b/doc/sphinx/book/connectors/__c.rst index eb3c16a832bddc9579de0f70b2dd017730f54087..5a610449d19f43053fd0f2796f0fd06662f5d1c9 100644 --- a/doc/sphinx/book/connectors/__c.rst +++ b/doc/sphinx/book/connectors/__c.rst @@ -33,13 +33,6 @@ space :code:`examples` via the high-level C API. tnt_stream_free(tnt); } -:ref:`SETUP <c_setup>`,|br| -:ref:`CONNECT <c_connect>`,|br| -:ref:`MAKE REQUEST <c_make_request>`,|br| -:ref:`SEND REQUEST <c_send_request>`,|br| -:ref:`GET REPLY <c_get_reply>`,|br| -:ref:`TEARDOWN <c_teardown>` - To prepare, paste the code into a file named example.c and install tarantool-c. One way to install tarantool-c (using Ubuntu) is: diff --git a/doc/sphinx/book/connectors/index.rst b/doc/sphinx/book/connectors/index.rst index 237701f69a3dfd8c8ac63e09719d199d849b8224..5a6f9bf0e9b52ad2d7b2ef9dc90bf82656813b6b 100644 --- a/doc/sphinx/book/connectors/index.rst +++ b/doc/sphinx/book/connectors/index.rst @@ -38,10 +38,15 @@ components is in file :ref:`iproto protocol`. .. container:: table + .. rst-class:: left-align-column-1 + .. rst-class:: right-align-column-2 + .. rst-class:: right-align-column-3 + .. rst-class:: right-align-column-4 + +---------------------------------+---------+---------+---------+---------+ | Component | Byte #0 | Byte #1 | Byte #2 | Byte #3 | +=================================+=========+=========+=========+=========+ - | code for insert | 2 | | | | + | code for insert | 02 | | | | +---------------------------------+---------+---------+---------+---------+ | rest of header | ... | ... | ... | ... | +---------------------------------+---------+---------+---------+---------+ diff --git a/doc/sphinx/dev_guide/building_from_source.rst b/doc/sphinx/dev_guide/building_from_source.rst index 6b74663b2a52d9523ffcf0d4335b423a199c74e2..374ddadf0ae7d4bd961d572cd59b42069e7b8a60 100644 --- a/doc/sphinx/dev_guide/building_from_source.rst +++ b/doc/sphinx/dev_guide/building_from_source.rst @@ -217,7 +217,7 @@ This is the end of the list of steps to take for source downloads. For your added convenience, github.com has README files with example scripts: |br| `README.CentOS <https://github.com/tarantool/tarantool/blob/master/README.CentOS>`_ for CentOS 5.8, |br| `README.FreeBSD <https://github.com/tarantool/tarantool/blob/master/README.FreeBSD>`_ for FreeBSD 10.1, |br| -`README.MacOSX <https://github.com/tarantool/tarantool/blob/master/README.MacOSX>`_ for Mac OS X `Lion`, |br| +`README.MacOSX <https://github.com/tarantool/tarantool/blob/master/README.MacOSX>`_ for Mac OS X `El Capitan`, |br| `README.md <https://github.com/tarantool/tarantool/blob/master/README.md>`_ for generic GNU/Linux. |br| These example scripts assume that the intent is to download from the master branch, build the server (but not the documentation), and run tests after build. diff --git a/doc/sphinx/getting_started.rst b/doc/sphinx/getting_started.rst index a9d0c2be85c2bba30a709574e2a9e1e273e285c6..05089cc34bf37a1b87370001fda0c07c15e0824b 100644 --- a/doc/sphinx/getting_started.rst +++ b/doc/sphinx/getting_started.rst @@ -196,7 +196,7 @@ Choose the package you want. You can install tarantool via Homebrew. It contains binaries for OS X 10.09 and higher. Simply use: -.. code-block:: session +.. code-block:: bash $ brew install tarantool ==> Downloading https://homebrew.bintray.com/bottles/tarantool-1.6.7-593.el_capitan.bottle.tar.gz diff --git a/doc/sphinx/reference/pickle.rst b/doc/sphinx/reference/pickle.rst index 6a084dc5433af5c5770e62096f72529487f08250..07f9ae0e710e42fc308c69d8814c662821462b97 100644 --- a/doc/sphinx/reference/pickle.rst +++ b/doc/sphinx/reference/pickle.rst @@ -14,6 +14,8 @@ **Format specifiers** + .. rst-class:: left-align-column-2 + +------+-------------------------------------------------+ | b, B | converts Lua variable to a 1-byte integer, | | | and stores the integer in the resulting string | diff --git a/doc/sphinx/reference/socket.rst b/doc/sphinx/reference/socket.rst index 6003e925aca014a39e4fad2a12df3abdc694c523..62091100f61eba738fd4e51173f0ff34f22867ea 100644 --- a/doc/sphinx/reference/socket.rst +++ b/doc/sphinx/reference/socket.rst @@ -21,62 +21,64 @@ are ``errno``, ``error``. **Socket functions** + .. rst-class:: left-align-column-2 + +----------------+---------------------------------------------------------------+ | Purposes | Names | +================+===============================================================+ - | | :func:`socket() <socket.__call>` | - | +---------------------------------------------------------------+ - | setup | :func:`socket.tcp_connect() <socket.tcp_connect>` | - | +---------------------------------------------------------------+ - | | :func:`socket.tcp_server() <socket.tcp_server>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:sysconnect() <socket_object.sysconnect>` | + | setup | :func:`socket() <socket.__call>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket.tcp_connect() <socket.tcp_connect>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket.tcp_server() <socket.tcp_server>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:sysconnect() <socket_object.sysconnect>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:send() <socket_object.send>` | + +----------------+---------------------------------------------------------------+ + | sending | :func:`socket_object:sendto() <socket_object.sendto>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:write() <socket_object.write>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:syswrite() <socket_object.syswrite>` | + +----------------+---------------------------------------------------------------+ + | receiving | :func:`socket_object:recv() <socket_object.recv>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:recvfrom() <socket_object.recvfrom>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:read() <socket_object.read>` | + +----------------+---------------------------------------------------------------+ + | flag setting | :func:`socket_object:nonblock() <socket_object.nonblock>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:setsockopt() <socket_object.setsockopt>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:linger() <socket_object.linger>` | + +----------------+---------------------------------------------------------------+ + | client/server | :func:`socket_object:listen() <socket_object.listen>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:accept() <socket_object.accept>` | + +----------------+---------------------------------------------------------------+ + | teardown | :func:`socket_object:shutdown() <socket_object.shutdown>` | + +----------------+---------------------------------------------------------------+ + | "" | :func:`socket_object:close() <socket_object.close>` | + +----------------+---------------------------------------------------------------+ + | error checking | :func:`socket_object:error() <socket_object.error>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:send() <socket_object.send>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:sendto() <socket_object.sendto>` | - | sending +---------------------------------------------------------------+ - | | :func:`socket_object:write() <socket_object.write>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:syswrite() <socket_object.syswrite>` | + | "" | :func:`socket_object:errno() <socket_object.errno>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:recv() <socket_object.recv>` | - | +---------------------------------------------------------------+ - | receiving | :func:`socket_object:recvfrom() <socket_object.recvfrom>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:read() <socket_object.read>` | + | information | :func:`socket.getaddrinfo() <socket.getaddrinfo>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:nonblock() <socket_object.nonblock>` | - | +---------------------------------------------------------------+ - | flag setting | :func:`socket_object:setsockopt() <socket_object.setsockopt>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:linger() <socket_object.linger>` | + | "" | :func:`socket_object:getsockopt() <socket_object.getsockopt>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:listen() <socket_object.listen>` | - | client/server +---------------------------------------------------------------+ - | | :func:`socket_object:accept() <socket_object.accept>` | + | "" | :func:`socket_object:peer() <socket_object.peer>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:shutdown() <socket_object.shutdown>` | - | teardown +---------------------------------------------------------------+ - | | :func:`socket_object:close() <socket_object.close>` | + | "" | :func:`socket_object:name() <socket_object.name>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:error() <socket_object.error>` | - | error checking +---------------------------------------------------------------+ - | | :func:`socket_object:errno() <socket_object.errno>` | + | state checking | :func:`socket_object:readable() <socket_object.readable>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket.getaddrinfo() <socket.getaddrinfo>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:getsockopt() <socket_object.getsockopt>` | - | information +---------------------------------------------------------------+ - | | :func:`socket_object:peer() <socket_object.peer>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:name() <socket_object.name>` | + | "" | :func:`socket_object:writable() <socket_object.writable>` | +----------------+---------------------------------------------------------------+ - | | :func:`socket_object:readable() <socket_object.readable>` | - | +---------------------------------------------------------------+ - | state checking | :func:`socket_object:writable() <socket_object.writable>` | - | +---------------------------------------------------------------+ - | | :func:`socket_object:wait() <socket_object.wait>` | + | "" | :func:`socket_object:wait() <socket_object.wait>` | +----------------+---------------------------------------------------------------+ Typically a socket session will begin with the setup functions, will set one