added check for connected when triggered method is called. can't trigger
[urisagit/Stem.git] / Design / socket_notes
CommitLineData
4536f655 1 Stem::Socket Design Notes
2
3The Stem::Socket module provides an interface to create connected
4sockets. It can either connect to a remote socket as a client or listen
5for connections as a server. Its constructor takes an owner object, an
6optional host or IP address and a required port number. Also a boolean
7flag designates whether is it a client or server. If no host argument is
8provided, it will default to localhost. To make a server listen on any
9IP address (with the wild card INADDR_ANY), pass in the empty string ''
10as the host.
11
12When a socket connection is made (either a client or a server), the
13owner object is notified by a callback and the handle of the newly
14created socket is passed to it. Since a client socket can timeout when
15connecting to a server, a timeout value can be set. If the connection
16request times out a different method is used as the callback to the
17owner object.
18
19This module is only used internally and should not be configured.