Changeset 26:46f4e06241c7 in xplcommon
- Timestamp:
- 01/02/13 08:04:37 (12 years ago)
- Branch:
- default
- Phase:
- public
- Location:
- src/xplcommon/win32
- Files:
-
- 1 deleted
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
src/xplcommon/win32/LocalServerSocketBase.cc
r25 r26 60 60 { 61 61 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); 65 76 } 66 return result;67 77 } 68 78 -
src/xplcommon/win32/LocalSocket.h
r22 r26 58 58 static void setupPath(char* dest, const char* name); 59 59 60 /**61 * Create a new named pipe with the proper settings. The handle62 * will be returned on successful creation.63 *64 * @param name the name of the pipe to create. It should be the65 * 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 is75 * 0 and false is returned, it has failed. If overlapped is not 0,76 * the failer status of the Failable associated with the77 * Overlapped instance provides failure information.78 */79 static bool connectNamedPipe(HANDLE handle, Overlapped* overlapped);80 81 60 protected: 82 61 /** … … 105 84 { 106 85 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;120 86 } 121 87 -
src/xplcommon/win32/Makefile.am
r21 r26 11 11 LocalAcceptor.cc \ 12 12 LocalServerSocketBase.cc\ 13 LocalConnector.cc \ 14 LocalClientSocket.cc 13 LocalConnector.cc 15 14 16 15 include_xplcommon_win32dir=$(includedir)/xplcommon/win32 -
src/xplcommon/win32/Overlapped.h
r22 r26 85 85 * bytes read or written, which may be 0 for an end-of-file 86 86 * condition 87 * @param file the handle of the fileon which the operation in87 * @param file the handle of the object on which the operation in 88 88 * question was performed 89 89 *
Note:
See TracChangeset
for help on using the changeset viewer.