function ReceiveMessage(out MessageType: TScWebSocketMessageType): TBytes; overload;

function ReceiveMessage(MSecTimeout: cardinal; out MessageType: TScWebSocketMessageType): TBytes; overload;

procedure ReceiveMessage(Stream: TStream; out MessageType: TScWebSocketMessageType); overload;

procedure ReceiveMessage(Stream: TStream; MSecTimeout: cardinal; out MessageType: TScWebSocketMessageType); overload;



Call ReceiveMessage to read the first message received from the Web server. ReceiveMessage returns an array of bytes or fill the Stream parameter, where the received message body will be recorded.

Types of data message received from the server and returned by the MessageType parameter.

If the client did not receive any messages from the server when calling the method, it will wait for the time specified in the Options.ReadWriteTimeout property or in the MSecTimeout parameter. If no messages were received during this time, the method will generate an error. If at least part of the message was received, the method will wait for the end of the message.


To retrieve data as it is received from the server, use the Receive method.


Note: This method cannot be called if the OnMessage event handler is set. In this case, an exception will be generated.


See Also



SecureBridge Components, Copyright © 2007-2021 Devart. All Rights Reserved. Provide Feedback Visit Forum Request Support