Changeset 22:d13fbc745959 in xplcommon for src/xplcommon/win32/LocalSocket.h
- Timestamp:
- 01/02/13 06:43:16 (11 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/xplcommon/win32/LocalSocket.h
r21 r22 51 51 public: 52 52 /** 53 * Create a concrete pipe namefrom the given user-specified name.53 * Create a concrete pipe path from the given user-specified name. 54 54 * 55 55 * @param dest the destination buffer, which should be at least 56 56 * 256 bytes long. 57 57 */ 58 static void setup Name(char* dest, const char* name);58 static void setupPath(char* dest, const char* name); 59 59 60 60 /** … … 90 90 protected: 91 91 /** 92 * Connect the named pipe with the current handle of this object. 93 * 94 * @return whether the connection succeeded. If not, it may be a 95 * failure, which is then indicated, or it may be an overlapped 96 * operation which needs to wait. 92 * Connect the client socket to the server. 97 93 */ 98 bool connect( Overlapped* overlapped);94 bool connect(const char* path); 99 95 100 96 friend class LocalAcceptor; … … 106 102 //------------------------------------------------------------------------------ 107 103 108 inline void LocalSocket::setup Name(char* dest, const char* name)104 inline void LocalSocket::setupPath(char* dest, const char* name) 109 105 { 110 106 snprintf(dest, 256, "\\\\.\\pipe\\%s", name); … … 134 130 //------------------------------------------------------------------------------ 135 131 136 inline bool LocalSocket::connect( Overlapped* overlapped)132 inline bool LocalSocket::connect(const char* path) 137 133 { 138 bool result = connectNamedPipe(handle, overlapped); 139 if (!result && overlapped==0) { 134 handle = CreateFile(path, GENERIC_READ|GENERIC_WRITE, 135 0, 0, OPEN_EXISTING, 136 FILE_FLAG_NO_BUFFERING | FILE_FLAG_OVERLAPPED, 0); 137 if (handle==0) { 140 138 setErrorCode(GetLastError()); 141 139 } 142 return result; 140 141 return handle!=0; 143 142 } 144 143
Note:
See TracChangeset
for help on using the changeset viewer.