trantor
Non-blocking I/O cross-platform TCP network library, using C++14
Loading...
Searching...
No Matches
trantor Namespace Reference

Namespaces

namespace  utils
 Trantor helper functions.

Classes

class  EventLoop
 As the name implies, this class represents an event loop that runs in a particular thread. The event loop can handle network I/O events and timers in asynchronous mode. More...
class  EventLoopThread
 This class represents an event loop thread. More...
class  EventLoopThreadPool
 This class represents a pool of EventLoopThread objects. More...
class  InetAddress
 Wrapper of sockaddr_in. This is an POD interface class. More...
class  TcpClient
 This class represents a TCP client. More...
class  TcpConnection
 This class represents a TCP connection. More...
class  TcpServer
 This class represents a TCP server. More...
class  AsyncStream
 This class represents a data stream that can be sent asynchronously. The data is sent in chunks, and the chunks are sent in order, and all the chunks are sent continuously. More...
class  Resolver
 This class represents an asynchronous DNS resolver. More...
class  Channel
 This class is used to implement reactor pattern. A Channel object manages a socket fd. Users use a Channel object to receive write or read events on the socket it manages. More...
struct  Certificate
struct  TLSPolicy
class  AsyncFileLogger
 This class implements utility functions for writing logs to files asynchronously. More...
class  ConcurrentTaskQueue
 This class implements a task queue running in parallel. Basically this can be called a threads pool. More...
class  Date
 This class represents a time point. More...
class  MpscQueue
 This class template represents a lock-free multiple producers single consumer queue. More...
class  LogStream
class  Fmt
class  Logger
 This class implements log functions. More...
class  RawLogger
class  MsgBuffer
 This class represents a memory buffer used for sending and receiving data. More...
class  NonCopyable
 This class represents a non-copyable object. More...
class  ObjectPool
 This class template represents a object pool. More...
class  SerialTaskQueue
 This class represents a task queue in which all tasks are executed one by one. More...
class  TaskQueue
 This class is a pure virtual class that can be implemented as a SerialTaskQueue or a ConcurrentTaskQueue. More...
class  TimingWheel
 This class implements a timer strategy with high performance and low accuracy. This is usually used internally. More...

Typedefs

using ChannelList = std::vector<Channel *>
using Func = std::function<void()>
using TimerId = uint64_t
using ConnectorPtr = std::shared_ptr<Connector>
using SSLContextPtr = std::shared_ptr<SSLContext>
using AsyncStreamPtr = std::unique_ptr<AsyncStream>
using TimerCallback = std::function<void()>
using TcpConnectionPtr = std::shared_ptr<TcpConnection>
using RecvMessageCallback
using ConnectionErrorCallback = std::function<void()>
using ConnectionCallback = std::function<void(const TcpConnectionPtr &)>
using CloseCallback = std::function<void(const TcpConnectionPtr &)>
using WriteCompleteCallback = std::function<void(const TcpConnectionPtr &)>
using HighWaterMarkCallback
using SSLErrorCallback = std::function<void(SSLError)>
using SockOptCallback = std::function<void(int)>
using CertificatePtr = std::shared_ptr<Certificate>
using TLSPolicyPtr = std::shared_ptr<TLSPolicy>
using StringPtr = std::shared_ptr<std::string>
using StringPtrQueue = std::queue<StringPtr>
using EntryPtr = std::shared_ptr<void>
using EntryBucket = std::unordered_set<EntryPtr>
using BucketQueue = std::deque<EntryBucket>

Enumerations

enum  { InvalidTimerId = 0 }
enum class  SSLError { kSSLHandshakeError , kSSLInvalidCertificate , kSSLProtocolError }

Functions

TRANTOR_EXPORT SSLContextPtr newSSLContext (const TLSPolicy &policy, bool server)
uint64_t hton64 (uint64_t n)
uint64_t ntoh64 (uint64_t n)
std::vector< std::string > splitString (const std::string &s, const std::string &delimiter, bool acceptEmptyString=false)
LogStreamoperator<< (LogStream &s, const Fmt &fmt)
const char * strerror_tl (int savedErrno)
void swap (MsgBuffer &one, MsgBuffer &two) noexcept

Detailed Description

callbacks.h An Tao

Public header file in trantor lib.

Copyright 2018, An Tao. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the License file.

Funcs.h An Tao

Public header file in trantor lib.

Copyright 2018, An Tao. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the License file.

SerialTaskQueue.h An Tao

Public header file in trantor lib.

Copyright 2018, An Tao. All rights reserved. Use of this source code is governed by a BSD-style license that can be found in the License file.

Typedef Documentation

◆ HighWaterMarkCallback

using trantor::HighWaterMarkCallback
Initial value:
std::function<void(const TcpConnectionPtr &, const size_t)>

◆ RecvMessageCallback

using trantor::RecvMessageCallback
Initial value:
std::function<void(const TcpConnectionPtr &, MsgBuffer *)>
This class represents a memory buffer used for sending and receiving data.
Definition MsgBuffer.h:40