iocp (v1.1.0)

::iocp::inetTop, Main, Index

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, Index

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

Returns a client or server TCP/IP channel.

socket ?args?
argsSee the Tcl core socket command.

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.

-keepalive BOOLControls the socket SO_KEEPALIVE option.
-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.
-nagle BOOLControls the socket TCL_NODELAY option.
-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.