Click here to Skip to main content
15,565,530 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin22-Jun-15 10:49
professionalAlbert Holguin22-Jun-15 10:49 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Vaclav_22-Jun-15 16:42
Vaclav_22-Jun-15 16:42 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Frankie-C22-Jun-15 23:44
Frankie-C22-Jun-15 23:44 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Vaclav_23-Jun-15 5:44
Vaclav_23-Jun-15 5:44 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin24-Jun-15 13:12
professionalAlbert Holguin24-Jun-15 13:12 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Vaclav_26-Jun-15 6:25
Vaclav_26-Jun-15 6:25 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin26-Jun-15 11:16
professionalAlbert Holguin26-Jun-15 11:16 
GeneralJust released the latest version of my open source project... Pin
Corvusoft21-Jun-15 5:30
Corvusoft21-Jun-15 5:30 
I'd love to hear any feed back regarding design, style and architecture.

You can find the source at http://github.com/corvusoft/restbed.

Asynchronous RESTful framework
C++
#include <memory>
#include <cstdlib>
#include <restbed>

using namespace std;
using namespace restbed;

void get_method_handler( const shared_ptr< Session >& session )
{
    const auto request = session->get_request( );

    size_t content_length = 0;
    request->get_header( "Content-Length", content_length );

    session->fetch( content_length, [ ]( const shared_ptr< Session >& session,
                                         const Bytes& body )
    {
        fprintf( stdout, "%.*s\n", ( int ) body.size( ), body.data( ) );

        session->close( OK, "Hello, World!", { { "Content-Length", "13" } } );
    } );
}

int main( const int, const char** )
{
    auto resource = make_shared< Resource >( );
    resource->set_path( "/resource" );
    resource->set_method_handler( "GET", get_method_handler );

    auto settings = make_shared< Settings >( );
    settings->set_port( 1984 );
    settings->set_default_header( "Connection", "close" );

    Service service;
    service.publish( resource );
    service.start( settings );

    return EXIT_SUCCESS;
}


modified 21-Jun-15 10:42am.

GeneralRe: Just released the latest version of my open source project... Pin
CPallini21-Jun-15 22:37
mveCPallini21-Jun-15 22:37 
GeneralRe: Just released the latest version of my open source project... Pin
Corvusoft21-Jun-15 22:50
Corvusoft21-Jun-15 22:50 
GeneralRe: Just released the latest version of my open source project... Pin
CPallini22-Jun-15 3:04
mveCPallini22-Jun-15 3:04 
GeneralRe: Just released the latest version of my open source project... Pin
Corvusoft21-Jun-15 22:52
Corvusoft21-Jun-15 22:52 
QuestionUpdatePanningFeedback() moves entire application window Pin
bob1697220-Jun-15 4:05
bob1697220-Jun-15 4:05 
QuestionDoubt Pin
Member 1177902719-Jun-15 17:38
Member 1177902719-Jun-15 17:38 
AnswerRe: Doubt Pin
Richard MacCutchan19-Jun-15 22:13
mveRichard MacCutchan19-Jun-15 22:13 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 22:07
Member 1177902720-Jun-15 22:07 
QuestionRe: Doubt Pin
Richard MacCutchan20-Jun-15 22:14
mveRichard MacCutchan20-Jun-15 22:14 
AnswerRe: Doubt Pin
Member 1177902720-Jun-15 22:21
Member 1177902720-Jun-15 22:21 
GeneralRe: Doubt Pin
Richard MacCutchan20-Jun-15 22:33
mveRichard MacCutchan20-Jun-15 22:33 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 22:40
Member 1177902720-Jun-15 22:40 
GeneralRe: Doubt Pin
Richard MacCutchan21-Jun-15 2:29
mveRichard MacCutchan21-Jun-15 2:29 
AnswerRe: Doubt Pin
Member 1177902720-Jun-15 22:32
Member 1177902720-Jun-15 22:32 
AnswerRe: Doubt Pin
CPallini20-Jun-15 0:41
mveCPallini20-Jun-15 0:41 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 21:49
Member 1177902720-Jun-15 21:49 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 21:52
Member 1177902720-Jun-15 21:52 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.