wodSSHServer ActiveX Control - ReceiveData Method
      
 

Description

Receives data from the user, as byte array.


Return Type

A Variant value.  Byte array that contains received data.


Syntax

object.ReceiveData ([ServiceIndex], [Count])



The ReceiveData Method syntax has these parts:

Part Description
object An expression evaluating to an object of type SSHUser.
ServiceIndex Optional. A Variant value. Index of the service you're receiving data from.
Count Optional. 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.