The Grid Community Toolkit documentation was taken from the Globus Toolkit 6.0 documentation. As a result, there may be inaccuracies and outdated information. Please report any problems to the Grid Community Forums as GitHub issues.

GCTXIO → GCT 6.2 Component Guide to Public Interfaces: XIO


Programming Model Overview

Globus XIO is based on an event based asynchronous programming model. This model is described in great detail at: Asynchronous Event Handling. In short, with Globus XIO, connections are opened and closed. While open, read and write requests are posted with a callback function pointer given by the user. When the event completes, the given callback is called.

Component API

You can find documentation of the XIO library at:

For information on the internationalization API, see C Common Library APIs.

Environmental variables

Environmental variables for XIO

The vast majority of the environment variables that affect the Globus XIO framework are defined by the driver in use. The following are links to descriptions of the more common driver environment variables:

Appendix A: Errors


Table 1. XIO Errors
Error Code Definition Possible Solutions

Operation was canceled

An I/O operation has been canceled by a close or a cancel

In most cases this will be intentionally performed by the application developer. In unexpected cases the applciation developer should verify that there is not a race condition relating to closing a handle.

Operation timed out

Occurs when the application developer associates a timeout with a handle’s I/O operations. If no I/O is performed before the timeout expires this error will be triggered.

The remote side of connection might be hung and busy. The network could have higher latencies than expected. The filesystem might be over worked.

An end of file occurred

This occurs when and EOF is detected on the file descriptor

When doing file I/O this like means you read to the end of the file and thus you are finished and should now close it. On network connections however it means the socket was closed on the remote end. This can happen it the remote side suddenly dies (seg-fault is common here) or if the remote side chooses to close the connection.

Contact string invalid

A poorly formed contact string was passed in to open

Verify the format of the contact string with the documentation of the drivers in use.

Memory allocation failed on XXXX

malloc failed. The system is likely quite overloaded

Free up memory in your application

System error in XXXX

A low level system error occurred. The errno and errstring should indicate more information.

Invalid stack

The requested stack does not meet XIO standards

Most likely a transport driver is not on the bottom of the stack, or 2 transport drivers are in the stack.

Operation already registered

With certain common drivers like TCP and FILE, only one specific operations can be registered at a time (1 read, 1 write). If another operation of the same type is posted to the handle before receiving the previous operations callback, this error can occur.

Restructure the application code so that it waits for the callback before registering the next IO operation.

Unexpected state

The internal logic of XIO came across a logical path that should not be possible. Often times this is due to application memory corruption or trying to perform an IO operation on a closed or otherwise invalid handle.

Use valgrind or some sort of memory managment tool to verify there is no memory corruption. Try to recreate the problem in a small program. Submit the program and the memory trace to the Globus bug tracker.

Driver in handle has been unloaded

A driver associated with the offending operation has already been unloaded by the application code.

Verify that you are not unloading drivers until they are no longer in use.

Module not activated

globus_module_activate(GLOBUS_XIO_MODULE); has not been called.

Call this before making any other XIO API calls.