::iocp::inetTop, Main

The iocp::inet namespace implements communication over TCP/IP. It provides the same interface as the Tcl core socket command but with greater performance.

The package is loaded as

package require iocp_inet

Commandsinet, Top, Main

socket [::iocp::inet]inet, Top, Main

Returns a client or server TCP/IP channel.

socket ?args?
Parameters
argsSee the Tcl core socket command.
Description

The command provides the same interface as the Tcl core socket command except for the additional socket options listed below. Refer to the documentation of the Tcl socket command for details.

The only functional enhancement offered by this command is significantly improved performance with reduced CPU load.

In addition to the standard configuration options supported by the Tcl socket command, the following additional configuration options are supported through the Tcl fconfigure and chan configure commands. They can be read as well as set.

-maxpendingaccepts COUNTMaximum number of pending accepts to post on the socket (listening socket only).
-maxpendingreads COUNTMaximum number of pending reads to post on the socket.
-maxpendingwrites COUNTMaximum number of pending writes to post on the socket.
-sorcvbuf BUFSIZESize of Winsock socket receive buffer.
-sosndbuf BUFSIZESize of Winsock socket send buffer.

It is recommended these be left at their default values except in cases where performance needs to be fine tuned for specific traffic patterns. The netbench utility may be used for the purpose.

The returned channel must be closed with the Tcl close or chan close command.

Return value

Returns a client or server TCP/IP channel.

proc ::iocp::inet::socket {args} {

    # Returns a client or server TCP/IP channel.
    #   args - see the Tcl core `socket` command
    #
    # The command provides the same interface as the Tcl core
    # [socket](http://www.tcl-lang.org/man/tcl8.6/TclCmd/socket.htm) command
    # except for the additional socket options listed below. Refer to the
    # documentation of the Tcl
    # [socket](http://www.tcl-lang.org/man/tcl8.6/TclCmd/socket.htm)
    # command for details.
    #
    # The only functional enhancement offered by this command is
    # significantly improved performance with reduced CPU load.
    #
    # In addition to the standard configuration options supported
    # by the Tcl `socket` command, the following additional configuration
    # options are supported through the Tcl `fconfigure` and
    # `chan configure` commands. They can be read as well as set.
    #
    #  -maxpendingaccepts COUNT - Maximum number of pending accepts to post
    #    on the socket (listening socket only).
    #  -maxpendingreads COUNT - Maximum number of pending reads to post
    #    on the socket.
    #  -maxpendingwrites COUNT - Maximum number of pending writes to post
    #    on the socket.
    #  -sorcvbuf BUFSIZE - Size of Winsock socket receive buffer.
    #  -sosndbuf BUFSIZE - Size of Winsock socket send buffer.
    #
    # It is recommended these be left at their default values except
    # in cases where performance needs to be fine tuned for specific
    # traffic patterns. The `netbench` utility may be used for the
    # purpose.
    #
    # The returned channel must be closed with the Tcl `close`
    # or `chan close` command.
}
Document generated by Ruff!