Back to product page

ReceiveData method


Receives data from the user, as byte array.

Type

A Variant value. Byte array that contains received data.

Syntax

  • Basic
object.ReceiveData ([ServiceIndex], [Count]) 
The ReceiveData(object,ServiceIndex,Count) syntax has these parts:
objectAn expression evaluating to an object of type SSHUser.
ServiceIndexOptional. A Variant value. Index of the service you're receiving data from.
CountOptional. A Variant value. Maximum number of bytes you want to receive.

Remarks

ReceiveData method will copy data from wodSSHD's internal buffers and pass it to byte array you can use in your code. Usually you will call this method as your response to Received event that was fired.

Specify ServiceIndex to determine which service you will read data from. Only makes sense to read from service type stNone, because all others services are handled automatically by wodSSHD or external programs, so reading data from buffers could either return 0 bytes (always), or interrupt above layer protocol and cause data corruption.

Usually you will not specify ServiceIndex because most users use only one service at a time - so default value 0 is used.

If you specify Count parameter then maximum of Count bytes will be returned - or maximum of what wodSSHD receive from the client.

If you don't receive all available data, then Received event will be fired again (and again and again...) until all data is read, because leaving it in the buffer can produce memory problems with wodSSHD.

Platforms

Windows