Back to product page

Received method


Called when there's data received from the user.

Type

None

Syntax

  • Basic
object.PortForwardRequest Owner, User, RemoteHost, RemotePort, Action
The Received(object,Owner,User,ServiceIndex,BytesCount) syntax has these parts:
objectAn expression evaluating to an object of type IwodSSHDNotify.
OwnerA wodSSHDcom object. Instance of wodSSHServer that called this notification method.
UserA SSHUser object. Reference to user who received the data.
ServiceIndexAn Integer value. Service index number (0 for main service).
BytesCountAn Integer value. Service index number (0 for main service).

Remarks

This method is called only if you implemented IwodSSHNotify interface in your application, and wodSSHD.Notification property has received reference to instance of your implementation.

This notification method is called when wodSSHD has received some data by the client, which should by visible to the application. You will receive this notification method only if you set ServiceType for the service referred by ServiceIndex to stNone. stNone means that you will deal with receiving/sending data by yourself, unlike other service types where wodSSHD deals with the received and sent data.

If user is using more than one service at the same time (opened more than one channel in SSH words) then ServiceIndex will hold information about particular service that is used. You should NEVER send data to the wrong service because unexpected results may occur. When you receive data for some service, for example one with index 0, then send data also to service 0.

BytesCount argument holds total number of bytes waiting to be read using Receive or ReceiveData methods. If those methods don't read all of available data, wodSSHD will call this notification method once again (and again and again....) immediately until you consume all data. This is made so that wodSSHD doesn't buffer too much data and don't produce memory problems. Leaving Received notification method with no body can lead to unlimited loop between wodSSHD and your software, so please put some code there.

Platforms

Windows