Does it matter if ChannelSendEof is done between ChannelSendString and ChannelReadAndPoll, or is it ok to put it after GetReceivedText? Here's our pseudocode:
It shouldn't matter. The ChannelSendEof can come right after the final ChannelSendString. The EOF indicates that no more data will be sent in that direction (from client to server). The channel remains open, and flow of data can still occur in the other direction (from server to client). When the client wishes to terminate the channel, it should call ChannelSendClose.