Tcl Source Code

View Ticket
Login
Ticket UUID: a67f00204cf2abfa82f9bf8e5a4a363e1ec58a99
Title: chan encoding needs to be per-direction
Type: RFE Version: all
Submitter: cmcc Created on: 2014-03-20 19:39:01
Subsystem: 25. Channel System Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Open Last Modified: 2014-03-24 13:01:03
Resolution: None Closed By: nobody
    Closed on:
Description:
Channels may be configured to treat their content as encoded in one of the system encodings.  Channels which are sockets don't necessarily need the same encoding on inbound and outbound traffic.  One example is in a network server which expects requests in binary or ascii, but simultaneously tries to deliver responses in some encoded form.  HTTP is an example of a protocol in which such a pattern can easily arise.

Chans should, therefore, be able to have different read and write encodings.
User Comments: dgp added on 2014-03-24 13:01:03:
A channel is only managed by a single thread at a time.

Tcl_GetChannelThread() will tell you which thread it is.

dkf added on 2014-03-23 19:12:09:

Workaround: change the encoding when switching from reading to writing. (Don't know what happens with multiple threads, so don't ask me!)