Changeset 26:46f4e06241c7 in xplcommon


Ignore:
Timestamp:
01/02/13 08:04:37 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 2 'hg:/home/ivaradi/xplane/hg/xplcommon' '/'>, 'public')
Message:

Further cleanup

Location:
src/xplcommon/win32
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • src/xplcommon/win32/LocalServerSocketBase.cc

    r25 r26  
    6060{
    6161    if (overlapped!=0) overlapped->reset();
    62     bool result = LocalSocket::connectNamedPipe(handle, overlapped);
    63     if (!result && overlapped==0) {
    64         setErrorCode(GetLastError());
     62    bool result = ConnectNamedPipe(handle,
     63                                   (overlapped==0) ? 0 : overlapped->get());
     64    DWORD error = GetLastError();
     65    if (!result &&
     66        (overlapped==0 ||
     67         (error!=ERROR_IO_PENDING && error!=ERROR_IO_INCOMPLETE)))
     68    {
     69        setErrorCode(error);
     70        return false;
     71    } else if (overlapped==0) {
     72        return result;
     73    } else {
     74        DWORD dummy = 0;
     75        return overlapped->getResult(dummy, handle);
    6576    }
    66     return result;
    6777}
    6878
  • src/xplcommon/win32/LocalSocket.h

    r22 r26  
    5858    static void setupPath(char* dest, const char* name);
    5959
    60     /**
    61      * Create a new named pipe with the proper settings. The handle
    62      * will be returned on successful creation.
    63      *
    64      * @param name the name of the pipe to create. It should be the
    65      * final name, not the user-given one.
    66      *
    67      * @return the handle if the pipe could be created.
    68      */
    69     static HANDLE createNamedPipe(const char* name, bool overlapped);
    70 
    71     /**
    72      * Connect the named pipe with the given handle.
    73      *
    74      * @return true if the connection is established. If overlapped is
    75      * 0 and false is returned, it has failed. If overlapped is not 0,
    76      * the failer status of the Failable associated with the
    77      * Overlapped instance provides failure information.
    78      */
    79     static bool connectNamedPipe(HANDLE handle, Overlapped* overlapped);
    80 
    8160protected:
    8261    /**
     
    10584{
    10685    snprintf(dest, 256, "\\\\.\\pipe\\%s", name);
    107 }
    108 
    109 //------------------------------------------------------------------------------
    110 
    111 inline bool LocalSocket::connectNamedPipe(HANDLE handle, Overlapped* overlapped)
    112 {
    113     OVERLAPPED* ol = (overlapped==0) ? 0 : overlapped->get();
    114     bool result = ConnectNamedPipe(handle, ol);
    115     if (overlapped!=0) {
    116         DWORD dummy = 0;
    117         result = overlapped->getResult(dummy, handle);
    118     }
    119     return result;
    12086}
    12187
  • src/xplcommon/win32/Makefile.am

    r21 r26  
    1111        LocalAcceptor.cc        \
    1212        LocalServerSocketBase.cc\
    13         LocalConnector.cc       \
    14         LocalClientSocket.cc
     13        LocalConnector.cc
    1514
    1615include_xplcommon_win32dir=$(includedir)/xplcommon/win32
  • src/xplcommon/win32/Overlapped.h

    r22 r26  
    8585     * bytes read or written, which may be 0 for an end-of-file
    8686     * condition
    87      * @param file the handle of the file on which the operation in
     87     * @param file the handle of the object on which the operation in
    8888     * question was performed
    8989     *
Note: See TracChangeset for help on using the changeset viewer.