Back to product page

Received event

Fires when there's data received from the user.


  • Basic
Private Sub object_Received(User, ServiceIndex, BytesCount)
The Received(object,User,ServiceIndex,BytesCount) syntax has these parts:
objectA wodSSHD object.
UserA SSHUser object. Reference to user who sent some data.
ServiceIndexAn Integer value. Service index number (0 for main service).
BytesCountAn Integer value. Total number of bytes waiting to be received.


This event is fired when wodSSHD has received some data by the client, which should by visible to the application. You will receive this event 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 fire this event 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 event with no body can lead to unlimited loop between wodSSHD and your software, so please put some code there.