Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »


ON THIS PAGE

ifStreamReceive

SetLineEventPort(a As Object)
 
SetByteEventPort(a As Object)
 
SetReceiveEol(a As String or roByteArray)

You can pass either a string or a roByteArray instance to the ifStreamReceive.SetReceiveEol method. This means that a NUL byte can be used as a line terminator:

eol = CreateObject("roByteArray")
eol.Push(0)
mp = CreateObject("roMessagePort")
client = CreateObject("roTCPStream")
client.SetReceiveEol(eol)
client.SetLineEventPort(mp)


 SetMatcher(matcher As Object) As Boolean

Instructs the stream to use the specified matcher. This object returns True if successful. Pass Invalid to this method to stop using the specified matcher.


ifUserData

SetUserData(user_data As Object)

Sets the user data that will be returned when events are raised.

GetUserData() As Object

Returns the user data that has previously been set via SetUserData(). It will return Invalid if no data has been set.

ifStreamSend

SetSendEol(eol_sequence As String) As Void

Sets the EOL sequence when writing to the stream. The default value is CR (ASCII value 13). If you need to set this value to a non-printing character, use the chr() global function.

SendByte(byte As Integer) As Void

Writes the specified byte to the stream.

SendLine(string As String) As Void

Writes the specified characters to the stream followed by the current EOL sequence.

SendBlock(a As Dynamic) As Void

Writes the specified characters to the stream. This method can support either a string or an roByteArray. If the block is a string, any null bytes will terminate the block.

Flush()

ifTCPStream

GetFailureReason() As String

Yields additional useful information if an roTCPStream method fails.

ConnectTo(a As String, b As Integer) As Boolean

Connects the stream to the specified host (designated using a dotted quad) and port. The function returns True upon success.

Accept(a As Object) As Boolean

Accepts an incoming connection event. The function returns True upon success.

AsyncConnectTo(a As String, b As Integer) As Boolean

Attempts to connect the stream to the specified host (designated using a dotted quad) and port. The function returns False if this action is immediately impossible (for example, when the specified host is not in the correct format). Otherwise, the function returns True upon success. The connect proceeds in the background, and an roStreamConnectResultEvent is posted when the connect attempt succeeds or fails, to the message port set by either SetLineEventPort() or  SetByteEventPort().



  • No labels