29 #include "tdesocketbase.h"
30 #include "tdesocketdevice.h"
32 using namespace KNetwork;
34 class KNetwork::TDESocketBasePrivate
45 TDESocketBasePrivate()
51 : d(new TDESocketBasePrivate)
53 d->socketOptions = Blocking;
67 d->socketOptions = opts;
73 return d->socketOptions;
122 TQMutexLocker locker(
mutex());
138 TQMutexLocker locker(
mutex());
145 d->capabilities |= add;
146 d->capabilities &= ~remove;
147 return d->capabilities;
152 return d->device != 0L;
157 d->socketError =
error;
172 reason = i18n(
"Socket error code NoError",
"no error");
176 reason = i18n(
"Socket error code LookupFailure",
177 "name lookup has failed");
181 reason = i18n(
"Socket error code AddressInUse",
182 "address already in use");
186 reason = i18n(
"Socket error code AlreadyBound",
187 "socket is already bound");
191 reason = i18n(
"Socket error code AlreadyCreated",
192 "socket is already created");
196 reason = i18n(
"Socket error code NotBound",
197 "socket is not bound");
201 reason = i18n(
"Socket error code NotCreated",
202 "socket has not been created");
206 reason = i18n(
"Socket error code WouldBlock",
207 "operation would block");
210 case ConnectionRefused:
211 reason = i18n(
"Socket error code ConnectionRefused",
212 "connection actively refused");
215 case ConnectionTimedOut:
216 reason = i18n(
"Socket error code ConnectionTimedOut",
217 "connection timed out");
221 reason = i18n(
"Socket error code InProgress",
222 "operation is already in progress");
226 reason = i18n(
"Socket error code NetFailure",
227 "network failure occurred");
231 reason = i18n(
"Socket error code NotSupported",
232 "operation is not supported");
236 reason = i18n(
"Socket error code Timeout",
237 "timed operation timed out");
241 reason = i18n(
"Socket error code UnknownError",
242 "an unknown/unexpected error has happened");
245 case RemotelyDisconnected:
246 reason = i18n(
"Socket error code RemotelyDisconnected",
247 "remote host closed connection");
251 reason = TQString::null;
266 case RemotelyDisconnected:
273 void TDESocketBase::unsetSocketDevice()
302 unsigned char c = (
unsigned char)ch;