Artifacts Associated With Ticket 1329568fffffffff
Ticket change [356b186cdf] (rid 106922) by setok on 2005-10-18 15:54:04:
- assignee initialized to: "andreas_kupries"
- cmimetype initialized to: "text/plain"
- comment initialized to:
What happens if I open a socket with the -async option and then immediately start writing to the channel? The documentation mentions what happens when reading (although only in terms of [gets]). It does have information on how [flush] works, but if I write a large amount of information, is it possible I might fill up some buffer? What happens then?
- foundin initialized to: "obsolete: 8.4.11"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "setok"
- subsystem initialized to: "24. Channel Commands"
- title initialized to:
[socket -async] and [puts]: Inadequate documentation?
- type initialized to: "Bug"
Ticket change [8f359fbc29] (rid 120245) by andreas_kupries on 2006-03-15 04:55:55:
- icomment:
Logged In: YES user_id=75003 The puts command queues data only until the condition set via -buffering is met, and then invokes [flush] internally. At that point the description of [flush] takes over. By default it flushes when a -buffersize'd number of characters have accumulated. Or every line, or always. The best way of dealing with -async is to set a handler for writable events. It triggers when the connection is open, or has positively failed.
- login: "andreas_kupries"
- mimetype: "text/plain"
- priority changed to: "3 Low"
- username: "andreas_kupries"
- icomment:
Ticket change [c5b65c117a] (rid 112047) by setok on 2006-03-15 05:04:37:
- icomment:
Logged In: YES user_id=137542 Thank you for the response. However, this does not answer my question in all totality. What if the write buffer is full but a connection has not yet been made? This is not actually answered in the [flush] documentation either. Will an error occur if an attempt is made to flush the buffer, but the connection of an -async socket has not yet been completed? Or will the buffer be resized while we are waiting to connect?
- login: "setok"
- mimetype: "text/plain"
- username: "setok"
- icomment:
Ticket change [3dfc0465ee] (rid 121189) by andreas_kupries on 2006-03-16 05:30:13:
- icomment:
Logged In: YES user_id=75003 How about writing a tcl script which tests this ? My guess is that you would get an error as there should be no open/valid file handle Tcl can actually write to. Regarding buffer resizing, the only way to change buffer sizes is via fconfigure. The system does no automatic changes.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [524be388bb] (rid 137233) by oehhar on 2014-03-11 07:42:58:
- assignee changed to: "max"
- closer changed to: "nobody"
- comment changed to:
What happens if I open a socket with the -async option and then immediately start writing to the channel? The documentation mentions what happens when reading (although only in terms of [gets]). It does have information on how [flush] works, but if I write a large amount of information, is it possible I might fill up some buffer? What happens then?
- icomment:
In the current branch [bug-13d3af3ad5] this is addressed and works as follows: a) blocking socket set h [socket -async $host $port] ... puts $h $data With the puts, the socket is switched to syncroneous mode. If this succeeds, the puts succeeds, otherwise, the puts fails. b) non blocking but without event queue: set h [socket -async $host $port] fconfigure $h -blocking 0 gets $h $data I don't know what happens with a puts, but with gets, each time the async connect is proceeded until connected and then it returns any received data. There are now tests for that...
- login: "oehhar"
- mimetype: "text/plain"
- severity changed to: "Minor"
- username: "oehhar"
Ticket change [d89f277197] (rid 258295) by serhiy.storchaka on 2026-10-16 21:17:47:
- icomment:
The documentation now covers this: socket.n says that a blocking flush waits for the connection and a non-blocking one buffers the data, and chan.n says that non-blocking puts buffers without limit. Testing this found a 9.0 regression, reported as [251f46655c].
- login: "serhiy.storchaka"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- icomment:
Ticket change [c1f599f8ed] (rid 259951) by serhiy.storchaka on 2026-10-22 17:19:27:
- closedate changed to: "2461330.3873507986"
- closer changed to: "serhiy.storchaka"
- login: "serhiy.storchaka"