コード例 #1
0
ファイル: 5.c プロジェクト: SunshineAllWay/StringFaultDetect
int main() {
	Packet *packet = createPacket();
	if (packet != NULL) {
		destroyPacket(&packet);
		handlePacket(packet);
	}
	return 0;
}
コード例 #2
0
void test_gdbCreateMsgPacket_given_empty_string_should_return_a_complete_packet(void)
{
    char *packet;

    packet = gdbCreateMsgPacket("");

    TEST_ASSERT_EQUAL_STRING("$#00", packet);

    destroyPacket(packet);
}
コード例 #3
0
void test_gdbCreateMsgPacket_given_string_of_data_should_return_a_complete_packet(void)
{
    char data[] = "OK";
    char *packet;

    packet = gdbCreateMsgPacket(data);

    TEST_ASSERT_EQUAL_STRING("$OK#9a", packet);

    destroyPacket(packet);
}
コード例 #4
0
ファイル: node.cpp プロジェクト: aoighost/Equalizer
bool Node::_cmdConfigExit( co::Command& command )
{
    LB_TS_THREAD( _nodeThread );
    LBLOG( LOG_INIT ) << "Node exit " 
                      << command.get<NodeConfigExitPacket>() << std::endl;

    const Pipes& pipes = getPipes();
    for( Pipes::const_iterator i = pipes.begin(); i != pipes.end(); ++i )
    {
        Pipe* pipe = *i;
        pipe->waitExited();
    }
    
    _state = configExit() ? STATE_STOPPED : STATE_FAILED;
    transmitter.getQueue().wakeup();
    transmitter.join();
    _flushObjects();

    ConfigDestroyNodePacket destroyPacket( getID( ));
    getConfig()->send( getLocalNode(), destroyPacket );
    return true;
}
コード例 #5
0
ファイル: window.cpp プロジェクト: bohara/Equalizer
bool Window::_cmdConfigExit( co::Command& command )
{
    const WindowConfigExitPacket* packet =
        command.get<WindowConfigExitPacket>();
    LBLOG( LOG_INIT ) << "TASK window config exit " << packet << std::endl;

    if( _state != STATE_STOPPED )
    {
        if( getPipe()->isRunning( ) && _systemWindow )
        {
            makeCurrent();
            getPipe()->flushFrames( _objectManager );
        }
        // else emergency exit, no context available.

        _state = configExit() ? STATE_STOPPED : STATE_FAILED;
    }

    PipeDestroyWindowPacket destroyPacket( getID( ));
    getPipe()->send( getLocalNode(), destroyPacket );
    return true;
}
コード例 #6
0
ファイル: packet.c プロジェクト: somethingnew2-0/CS640-PA1
void destroyQueuedPacket(QueuedPacket* packet) {
  destroyPacket(packet->packet);
  free(packet);
}