• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdecore
 

tdecore

  • tdecore
  • network
kserversocket.h
1/*
2 * Copyright (C) 2003 Thiago Macieira <thiago@kde.org>
3 *
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining
6 * a copy of this software and associated documentation files (the
7 * "Software"), to deal in the Software without restriction, including
8 * without limitation the rights to use, copy, modify, merge, publish,
9 * distribute, sublicense, and/or sell copies of the Software, and to
10 * permit persons to whom the Software is furnished to do so, subject to
11 * the following conditions:
12 *
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
15 *
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 */
24
25#ifndef KSERVERSOCKET_H
26#define KSERVERSOCKET_H
27
28#include <tqobject.h>
29#include "tdesocketbase.h"
30
31namespace KNetwork {
32
33class TDESocketDevice;
34class KStreamSocket;
35class KResolver;
36class KResolverResults;
37
38class TDEServerSocketPrivate;
107class TDECORE_EXPORT TDEServerSocket: public TQObject, public KPassiveSocketBase
108{
109 TQ_OBJECT
110
111public:
122 TDEServerSocket(TQObject* parent = 0L, const char *name = 0L);
123
141 TDEServerSocket(const TQString& service, TQObject* parent = 0L, const char *name = 0L);
142
161 TDEServerSocket(const TQString& node, const TQString& service,
162 TQObject* parent = 0L, const char *name = 0L);
163
170 ~TDEServerSocket();
171
172protected:
176 virtual bool setSocketOptions(int opts);
177
178public:
187 KResolver& resolver() const;
188
192 const KResolverResults& resolverResults() const;
193
208 void setResolutionEnabled(bool enable);
209
216 void setFamily(int families);
217
231 void setAddress(const TQString& service);
232
248 void setAddress(const TQString& node, const TQString& service);
249
257 void setTimeout(int msecs);
258
276 virtual bool lookup();
277
291 virtual bool bind(const TQString& node, const TQString& service);
292
299 virtual bool bind(const TQString& service);
300
306 virtual bool bind();
307
315 virtual bool bind(const KResolverEntry& address);
316
330 virtual bool listen(int backlog = 5); // 5 is arbitrary
331
335 virtual void close();
336
348 void setAcceptBuffered(bool enable);
349
367 virtual KActiveSocketBase* accept();
368
372 virtual TDESocketAddress localAddress() const;
373
377 virtual TDESocketAddress externalAddress() const;
378
379private slots:
380 void lookupFinishedSlot();
381
382signals:
388 void gotError(int code);
389
393 void hostFound();
394
401 void bound(const KResolverEntry& local);
402
407 void closed();
408
414 void readyAccept();
415
416protected:
421 void copyError();
422
423private:
424 bool doBind();
425 bool doListen();
426
427private:
428 TDEServerSocket(const TDEServerSocket&);
429 TDEServerSocket& operator=(const TDEServerSocket&);
430
431 TDEServerSocketPrivate *d;
432};
433
434} // namespace KNetwork
435
436#endif
KNetwork::KActiveSocketBase
Abstract class for active sockets.
Definition: tdesocketbase.h:444
KNetwork::KPassiveSocketBase
Abstract base class for passive sockets.
Definition: tdesocketbase.h:684
KNetwork::KResolverEntry
One resolution entry.
Definition: kresolver.h:67
KNetwork::KResolverResults
Name and service resolution results.
Definition: kresolver.h:198
KNetwork::KResolver
Name and service resolution class.
Definition: kresolver.h:296
KNetwork::TDEServerSocket
A server socket for accepting connections.
Definition: kserversocket.h:108
KNetwork::TDEServerSocket::readyAccept
void readyAccept()
This signal is emitted whenever the socket is ready for accepting – i.e., there is at least one conne...
KNetwork::TDEServerSocket::bound
void bound(const KResolverEntry &local)
This signal is emitted when the socket successfully binds to an address.
KNetwork::TDEServerSocket::gotError
void gotError(int code)
This signal is emitted when this object finds an error.
KNetwork::TDEServerSocket::closed
void closed()
This signal is emitted when the socket completes the closing/shut down process.
KNetwork::TDEServerSocket::hostFound
void hostFound()
This signal is emitted when the lookup is successfully completed.
KNetwork::TDESocketAddress
A generic socket address.
Definition: tdesocketaddress.h:424
KNetwork
A namespace to store all networking-related (socket) classes.
Definition: kbufferedsocket.h:36

tdecore

Skip menu "tdecore"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdecore

Skip menu "tdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdecore by doxygen 1.9.4
This website is maintained by Timothy Pearson.