Click here to Skip to main content
15,884,237 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin22-Jun-15 9:49
professionalAlbert Holguin22-Jun-15 9:49 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Vaclav_22-Jun-15 15:42
Vaclav_22-Jun-15 15:42 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Frankie-C22-Jun-15 22:44
Frankie-C22-Jun-15 22:44 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Vaclav_23-Jun-15 4:44
Vaclav_23-Jun-15 4:44 
AnswerRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin24-Jun-15 12:12
professionalAlbert Holguin24-Jun-15 12:12 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Vaclav_26-Jun-15 5:25
Vaclav_26-Jun-15 5:25 
GeneralRe: Use #define or enum in switch() case(s) ? Pin
Albert Holguin26-Jun-15 10:16
professionalAlbert Holguin26-Jun-15 10:16 
GeneralJust released the latest version of my open source project... Pin
Corvusoft21-Jun-15 4:30
Corvusoft21-Jun-15 4: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 21:37
mveCPallini21-Jun-15 21:37 
GeneralRe: Just released the latest version of my open source project... Pin
Corvusoft21-Jun-15 21:50
Corvusoft21-Jun-15 21:50 
GeneralRe: Just released the latest version of my open source project... Pin
CPallini22-Jun-15 2:04
mveCPallini22-Jun-15 2:04 
GeneralRe: Just released the latest version of my open source project... Pin
Corvusoft21-Jun-15 21:52
Corvusoft21-Jun-15 21:52 
QuestionUpdatePanningFeedback() moves entire application window Pin
bob1697220-Jun-15 3:05
bob1697220-Jun-15 3:05 
QuestionDoubt Pin
Member 1177902719-Jun-15 16:38
Member 1177902719-Jun-15 16:38 
AnswerRe: Doubt Pin
Richard MacCutchan19-Jun-15 21:13
mveRichard MacCutchan19-Jun-15 21:13 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 21:07
Member 1177902720-Jun-15 21:07 
QuestionRe: Doubt Pin
Richard MacCutchan20-Jun-15 21:14
mveRichard MacCutchan20-Jun-15 21:14 
AnswerRe: Doubt Pin
Member 1177902720-Jun-15 21:21
Member 1177902720-Jun-15 21:21 
GeneralRe: Doubt Pin
Richard MacCutchan20-Jun-15 21:33
mveRichard MacCutchan20-Jun-15 21:33 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 21:40
Member 1177902720-Jun-15 21:40 
GeneralRe: Doubt Pin
Richard MacCutchan21-Jun-15 1:29
mveRichard MacCutchan21-Jun-15 1:29 
AnswerRe: Doubt Pin
Member 1177902720-Jun-15 21:32
Member 1177902720-Jun-15 21:32 
AnswerRe: Doubt Pin
CPallini19-Jun-15 23:41
mveCPallini19-Jun-15 23:41 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 20:49
Member 1177902720-Jun-15 20:49 
GeneralRe: Doubt Pin
Member 1177902720-Jun-15 20:52
Member 1177902720-Jun-15 20: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.