示例#1
0
static void on_underlying_io_close_complete(void* context)
{
	HEADER_DETECT_IO_INSTANCE* header_detect_io_instance = (HEADER_DETECT_IO_INSTANCE*)context;

	switch (header_detect_io_instance->io_state)
	{
	default:
		break;

    case IO_STATE_CLOSING:
        header_detect_io_instance->io_state = IO_STATE_NOT_OPEN;
        indicate_close_complete(header_detect_io_instance);
        break;

	case IO_STATE_WAIT_FOR_HEADER:
	case IO_STATE_OPENING_UNDERLYING_IO:
		header_detect_io_instance->io_state = IO_STATE_NOT_OPEN;
		indicate_open_complete(header_detect_io_instance, IO_OPEN_ERROR);
		break;
	}
}
示例#2
0
static void on_underlying_io_close_complete(void* context)
{
	SASL_CLIENT_IO_INSTANCE* sasl_client_io_instance = (SASL_CLIENT_IO_INSTANCE*)context;

	switch (sasl_client_io_instance->io_state)
	{
	default:
		break;

	case IO_STATE_OPENING_UNDERLYING_IO:
	case IO_STATE_SASL_HANDSHAKE:
		sasl_client_io_instance->io_state = IO_STATE_NOT_OPEN;
		indicate_open_complete(sasl_client_io_instance, IO_OPEN_ERROR);
		break;

	case IO_STATE_CLOSING:
		sasl_client_io_instance->io_state = IO_STATE_NOT_OPEN;
		indicate_close_complete(sasl_client_io_instance);
		break;
	}
}