Changeset 30:d92d686b4d70 in xplra


Ignore:
Timestamp:
02/09/13 08:59:10 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 3 'hg:/home/ivaradi/xplane/hg/xplra' '/'>, 'public')
Message:

Fixed problems with detecting a broken connection

Files:
1 added
4 edited

Legend:

Unmodified
Added
Removed
  • src/client/c/hu/varadiistvan/xplra/XPlane.cc

    r26 r30  
    4040
    4141#include <memory>
     42
     43#ifndef _WIN32
     44#include <signal.h>
     45#endif
    4246
    4347//------------------------------------------------------------------------------
     
    96100//------------------------------------------------------------------------------
    97101
    98 void XPlane::checkResult() throw(ProtocolException)
     102void XPlane::checkResult() throw(ProtocolException, IOException)
    99103{
    100104    uint8_t result = stream->readU8();
     
    137141        }
    138142    }
     143
     144#ifndef _WIN32
     145    signal(SIGPIPE, SIG_IGN);
     146#endif
    139147
    140148    socket = clientSocket.release();
  • src/client/c/hu/varadiistvan/xplra/XPlane.h

    r26 r30  
    280280    /**
    281281     * Read and check the result.  If it signifies an error,
    282      * throw a ProtocolException with the correct error code.
    283      */
    284     void checkResult() throw(ProtocolException);
     282     * throw a ProtocolException with the correct error code. If there
     283     * is some problem with the stream, an IOException is thrown.
     284     */
     285    void checkResult() throw(ProtocolException, IOException);
    285286
    286287    /**
  • test/Makefile.am

    r29 r30  
    66endif
    77
    8 noinst_PROGRAMS=ctest basictest basicctest multigettest multigetctest multisettest
     8noinst_PROGRAMS=ctest basictest basicctest multigettest multigetctest multisettest multisetctest
    99
    1010ctest_SOURCES=ctest.c
     
    2828
    2929multisettest_SOURCES=multisettest.cc
     30
     31multisetctest_SOURCES=multisetctest.c
     32if TARGET_API_WIN32
     33multisetctest_LDFLAGS=-lstdc++
     34endif
  • test/multigetctest.c

    r29 r30  
    3535#include <string.h>
    3636
    37 #ifdef __windows__
     37#ifdef _WIN32
    3838#include <windows.h>
    3939#else
     
    240240
    241241    while(1) {
    242         if (xplra_multi_execute(getterID)<0) return -1;
     242        if (xplra_multi_execute(getterID)<0) goto error;
    243243        printf("tail number: '%s', days: %d, zuluSec: %f\n",
    244244               tailnum, *days, *zuluSec);
     
    265265               busVolts[0], busVolts[1], busVolts[2], busVolts[3]);
    266266        printf("\n");
    267 #ifdef __windows__
     267#ifdef _WIN32
    268268        Sleep(1000);
    269269#else
Note: See TracChangeset for help on using the changeset viewer.