コード例 #1
0
ファイル: client.c プロジェクト: darkmoreTw/junkcode
int main( void ) {
	char buffer[4096];
	char password[4096];
	TCPSocket * socket = TCPSocket_new();
	int passwordLength = 0;

	TCPSocket_connect( socket, "127.0.0.1", 9527 );
	passwordLength = TCPSocket_read( socket, password, sizeof( password ) );
	TCPSocket_disconnect( socket );
	TCPSocket_delete( &socket );

	password[passwordLength] = '\0';

	printf( "Please type your password:\n" );
	fgets( buffer, sizeof( buffer ), stdin );

	if( strcmp( buffer, password ) == 0 ) {
		printMessage();
		blockByMilliseconds( 2 * 60 * 1000 );
	}

	deleteSelf();

	return 0;
}
コード例 #2
0
    bool keyPressed (const KeyPress& key) override
    {
        if (key == KeyPress::escapeKey)
        {
            dismissWithAnimation (true);
            deleteSelf();
            return true;
        }

        return false;
    }
コード例 #3
0
    void timerCallback() override
    {
        forceMouseCursorUpdate();

        if (sourceDetails.sourceComponent == nullptr)
        {
            deleteSelf();
        }
        else
        {
            for (auto& s : Desktop::getInstance().getMouseSources())
            {
                if (isOriginalInputSource (s) && ! s.isDragging())
                {
                    if (mouseDragSource != nullptr)
                        mouseDragSource->removeMouseListener (this);

                    deleteSelf();
                    break;
                }
            }
        }
    }
コード例 #4
0
ファイル: ptr.inl.hpp プロジェクト: 007Indian/opencv
 void decRef()
 {
     if (CV_XADD(&refCount, -1) == 1) deleteSelf();
 }