XltHost(3X) XltHost(3X)
NAME
XltHost - The Host widget class
SYNOPSIS
#include <Xlt/Host.h>
DESCRIPTION
Host is used by an application to communicate with a process via a tcp/ip socket connection.
Next paragraph
Next paragraph
Classes
Host inherits behavior and resources from the Object class.
The class pointer is XltHostWidgetClass.
The class name is XltHost.
New Resources
The following table defines a set of widget resources used by the programmer to specify data. The programmer can also set the resource
values for the inherited classes to set attributes for this widget. To reference a resource by name or by class in a .Xdefaults file,
remove the XmN or XmC prefix and use the remaining letters. To specify one of the defined values for a resource in a .Xdefaults file,
remove the Xm prefix and use the remaining letters (in either lowercase or uppercase, but include any underscores between words). The
codes in the access column indicate if the given resource can be set at creation time (C), set by using XtSetValues (S), retrieved by using
XtGetValues (G), or is not applicable (N/A).
XltHost Resource Set
Name Class Type Default Access
------------------------------------------------------------------------------------
XltNasciiInputCallback XtCCallback XtCallbackList NULL C
XltNbinaryInputCallback XtCCallback XtCallbackList NULL C
XltNconnectCallback XtCCallback XtCallbackList NULL C
XltNdelay XltCDelay int 0 CSG
XltNdisconnectCallback XtCCallback XtCallbackList NULL C
XltNhostType XtCHostType unsigned char XltHOST_CLIENT CSG
XltNinputCallback XtCCallback XtCallbackList NULL C
XltNname XltCName String "localhost" CSG
XltNoutputCallback XtCCallback XtCallbackList NULL C
XltNport XltCPort String dynamic CSG
XltNterminator XltCTerminator String "
" CSG
XltNasciiInputCallback
Specifies the list of callbacks that is called when one line of input has been received. A line is terminated by either
or
. A
blank line, "
", will not invoke the callback. The reason sent by the callback is XltCR_ASCIIINPUT.
XltNbinaryInputCallback
Specifies the list of callbacks that is called when binary data is received. Binary data is defined according to the Block Arguments
in the Tektronix TekScope Programmer Manual. The reason sent by the callback is XltCR_BINARYINPUT.
XltNconnectCallback
Specifies the list of callbacks that is called when the connection is established. A connection is not attempted until the parent of
the Host widget, usually the ApplicationShell, has been realized. The reason sent by the callback is XltCR_CONNECT.
XmNdelay
Specifies the minimum amount of time to delay between sending characters to the socket.
XltNdisconnectCallback
Specifies the list of callbacks that is called when the connection is closed. The reason sent by the callback is XltCR_DISCONNECT.
XltNhostType
Either XltHOST_CLIENT or XltHOST_SERVER.
XltNinputCallback
Specifies the list of callbacks that is called when data is received. The reason sent by the callback is XltCR_INPUT.
XltNname
Specifies the hostname to connect to. An XtGetValues on this resource returns a pointer to the actual string in the widget. Do not
free this string. If the hostType is XltHOST_SERVER this resource is not used.
XltNoutputCallback
Specifies the list of callbacks that is called when data byte is transmitted.
XltNport
Specifies the TCP service port to connect to. If not specified the name of the application will be used. An XtGetValues on this
resource returns a pointer to the actual string in the widget. Do not free this string. If the hostType is XltHOST_SERVER this
resource is the port that the listen socket is created on.
XltNterminator
Specifies a string that is appended to data send by XltHostSendString(3x). An XtGetValues on this resource returns a pointer to the
actual string in the widget. Do not free this string.
Inherited Resources
Host inherits behavior and resources from the following superclasses. For a complete description of each resource, refer to the man page
for that superclass.
Object Resource Set
Name Class Type Default Access
---------------------------------------------------------------------
XmNdestroyCallback XmCCallback XtCallbackList NULL C
XmNscreen XmCScreen Screen * dynamic CG
Callback Information
A pointer to the following structure is passed to each callback:
typedef struct
{
int reason;
char * data;
int len;
int input_size;
int input_need;
} XltHostCallbackStruct;
reason Indicates why the callback was invoked
data Points to the data that triggered the callback. This is undefined if reason is XltCR_CONNECT.
len Is the amount of data pointed to by data. This is undefined if reason is XltCR_CONNECT. This is the amount of data in the output
queue if the reason is XltCR_OUTPUT.
input_size
Is the amount of binary data received so far. This is only defined if reason is XltCR_INPUT and is only meaningful during a binary
data transfer.
input_need
Is the amount of binary data we expect to receive. This is only defined if reason is XltCR_INPUT and is only meaningful during a
binary data transfer.
Behavior
XltHost behavior is described below:
Host will attempt to make a connection to the host name and port when its parent, which should be the ApplicationShell, is realized.
If the name or port is changed the current connection is closed and a new connection will be established. The connection callback
is called when the stream is successfully opened. If the hostType is XltHOST_SERVER the listen socket is created when the parent is
realized. Clients that connect to this port will then receive all of the data sent with XltHostSendData/XltHostSendString.
Data sent to the Host, via XltHostSendData(3x) or XltHostSendString(3x), is sent to the stream one byte at a time with a delay of
XltNdelay between bytes. Additionally, XltHostSendString will append the XltNTerminator string to the data.
Data read from the stream is collected and passed to the various input callbacks as appropriate.
Virtual Bindings
The bindings for virtual keys are vendor specific. For information about bindings for virtual buttons and keys, see VirtualBindings(3X).
RELATED INFORMATION
Object(3X), XltCreateHost(3X), XltHostSelect(3X), XltHostSendData(3X), XltHostSendString(3X), XltHostCreateTranscript(3X), and XltHostDis-
cardOutput(3X).
XltHost(3X)