Archived Forum Post

Index of archived forum posts

Question:

Where to put ChannelSendEof?

Mar 02 '14 at 21:40

Does it matter if ChannelSendEof is done between ChannelSendString and ChannelReadAndPoll, or is it ok to put it after GetReceivedText? Here's our pseudocode:

OpenSessionChannel

SendReqPty

SendReqShell

ChannelSendString

ChannelReadAndPoll

GetReceivedText

ChannelSendEof

ChannelSendClose

Disconnect


Accepted Answer

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.