Bootstrap

常见网络服务器开发开源项目代码规模

这里总结了一些常见的网络服务器开发中用到的C/C++开发的开源项目核心代码的代码规模,主要是为了后续研读这些优秀的开源项目的代码,学习他们的设计而提供一些参考。

libev

项目主页:http://software.schmorp.de/pkg/libev.html

版本:4.22

libev是libevent之后的一个事件驱动的编程框架,其接口和libevent基本类似。这个库只支持*nix平台,因而可以抛掉很多为跨平台而有的负担,从而使得它的性能比libevent还要高,bug比libevent还少。

libev-4.22/ev_vars.h : 204
libev-4.22/ev_epoll.c : 282
libev-4.22/event.h : 177
libev-4.22/ev_kqueue.c : 214
libev-4.22/ev.h : 854
libev-4.22/ev_poll.c : 148
libev-4.22/ev.c : 5097
libev-4.22/ev_select.c : 314
libev-4.22/ev_wrap.h : 200
libev-4.22/event.c : 425
libev-4.22/ev++.h : 816
libev-4.22/ev_port.c : 185
total line num = 8916 filenum = 12

这个项目的核心代码,算上头文件和C实现文件,总共大概8916行。代码规模不大,倒是很方便我们学习高效的Linux环境下的C/C++编程。

muduo

项目主页:http://dirtysalt.info/muduo.html

Github主页:https://github.com/chenshuo/muduo

版本:1.0.8

这是一个基于 Reactor 模式的 C++ 网络库。这个项目同livev一样,只支持*nix平台。受益于不需要支持多平台,而使得这个库的性能相对于libevent要更好一些,代码量更少。这个项目的作者 陈硕 有本书专门分析解读了这个项目的code——《Linux多线程服务端编程》。在那本书里面还介绍了许多编写工业级Linux平台网络程序的许多技巧,因而还是很值得一读的。配合着 陈硕 的那本书,来研读这个项目的代码,相信一定可以更快地有所收获。

muduo-1.0.8/muduo/base/StringPiece.h : 207
muduo-1.0.8/muduo/base/LogFile.cc : 130
muduo-1.0.8/muduo/base/Thread.h : 55
muduo-1.0.8/muduo/base/Exception.h : 33
muduo-1.0.8/muduo/base/Condition.h : 56
muduo-1.0.8/muduo/base/Condition.cc : 20
muduo-1.0.8/muduo/base/Logging.cc : 222
muduo-1.0.8/muduo/base/Exception.cc : 57
muduo-1.0.8/muduo/base/Thread.cc : 223
muduo-1.0.8/muduo/base/LogFile.h : 54
muduo-1.0.8/muduo/base/Singleton.h : 76
muduo-1.0.8/muduo/base/LogStream.h : 199
muduo-1.0.8/muduo/base/BlockingQueue.h : 80
muduo-1.0.8/muduo/base/ProcessInfo.cc : 250
muduo-1.0.8/muduo/base/Types.h : 126
muduo-1.0.8/muduo/base/copyable.h : 16
muduo-1.0.8/muduo/base/WeakCallback.h : 124
muduo-1.0.8/muduo/base/Atomic.h : 95
muduo-1.0.8/muduo/base/BoundedBlockingQueue.h : 90
muduo-1.0.8/muduo/base/FileUtil.h : 92
muduo-1.0.8/muduo/base/CountDownLatch.cc : 41
muduo-1.0.8/muduo/base/ThreadPool.cc : 176
muduo-1.0.8/muduo/base/Date.cc : 75
muduo-1.0.8/muduo/base/ThreadLocalSingleton.h : 82
muduo-1.0.8/muduo/base/CurrentThread.h : 52
muduo-1.0.8/muduo/base/Logging.h : 154
muduo-1.0.8/muduo/base/Mutex.h : 163
muduo-1.0.8/muduo/base/Timestamp.h : 116
muduo-1.0.8/muduo/base/ThreadLocal.h : 58
muduo-1.0.8/muduo/base/AsyncLogging.h : 78
muduo-1.0.8/muduo/base/CountDownLatch.h : 36
muduo-1.0.8/muduo/base/AsyncLogging.cc : 129
muduo-1.0.8/muduo/base/Timestamp.cc : 58
muduo-1.0.8/muduo/base/ThreadPool.h : 68
muduo-1.0.8/muduo/base/LogStream.cc : 212
muduo-1.0.8/muduo/base/FileUtil.cc : 198
muduo-1.0.8/muduo/base/TimeZone.h : 51
muduo-1.0.8/muduo/base/TimeZone.cc : 358
muduo-1.0.8/muduo/base/ProcessInfo.h : 68
muduo-1.0.8/muduo/base/GzipFile.h : 84
muduo-1.0.8/muduo/base/Date.h : 118
muduo-1.0.8/muduo/net/InetAddress.h : 83
muduo-1.0.8/muduo/net/TcpConnection.cc : 429
muduo-1.0.8/muduo/net/TcpClient.h : 101
muduo-1.0.8/muduo/net/TimerQueue.h : 91
muduo-1.0.8/muduo/net/Acceptor.h : 60
muduo-1.0.8/muduo/net/TcpServer.cc : 122
muduo-1.0.8/muduo/net/EventLoop.h : 175
muduo-1.0.8/muduo/net/TimerQueue.cc : 277
muduo-1.0.8/muduo/net/Socket.h : 88
muduo-1.0.8/muduo/net/Buffer.h : 422
muduo-1.0.8/muduo/net/Buffer.cc : 58
muduo-1.0.8/muduo/net/SocketsOps.h : 64
muduo-1.0.8/muduo/net/SocketsOps.cc : 305
muduo-1.0.8/muduo/net/EventLoopThreadPool.cc : 100
muduo-1.0.8/muduo/net/TimerId.h : 53
muduo-1.0.8/muduo/net/Channel.h : 123
muduo-1.0.8/muduo/net/InetAddress.cc : 143
muduo-1.0.8/muduo/net/Poller.h : 71
muduo-1.0.8/muduo/net/Endian.h : 72
muduo-1.0.8/muduo/net/Poller.cc : 31
muduo-1.0.8/muduo/net/EventLoopThread.h : 52
muduo-1.0.8/muduo/net/EventLoopThread.cc : 77
muduo-1.0.8/muduo/net/EventLoop.cc : 319
muduo-1.0.8/muduo/net/Callbacks.h : 65
muduo-1.0.8/muduo/net/TcpConnection.h : 161
muduo-1.0.8/muduo/net/Connector.h : 75
muduo-1.0.8/muduo/net/EventLoopThreadPool.h : 69
muduo-1.0.8/muduo/net/Timer.cc : 26
muduo-1.0.8/muduo/net/ZlibStream.h : 146
muduo-1.0.8/muduo/net/TcpClient.cc : 183
muduo-1.0.8/muduo/net/Channel.cc : 146
muduo-1.0.8/muduo/net/Timer.h : 72
muduo-1.0.8/muduo/net/Connector.cc : 228
muduo-1.0.8/muduo/net/boilerplate.cc : 15
muduo-1.0.8/muduo/net/TcpServer.h : 123
muduo-1.0.8/muduo/net/Acceptor.cc : 90
muduo-1.0.8/muduo/net/Socket.cc : 129
muduo-1.0.8/muduo/net/boilerplate.h : 32
muduo-1.0.8/muduo/net/http/HttpServer.h : 71
muduo-1.0.8/muduo/net/http/HttpResponse.cc : 49
muduo-1.0.8/muduo/net/http/HttpRequest.h : 186
muduo-1.0.8/muduo/net/http/HttpContext.cc : 118
muduo-1.0.8/muduo/net/http/HttpResponse.h : 79
muduo-1.0.8/muduo/net/http/HttpContext.h : 72
muduo-1.0.8/muduo/net/http/HttpServer.cc : 106
muduo-1.0.8/muduo/net/protobuf/ProtobufCodecLite.cc : 226
muduo-1.0.8/muduo/net/protobuf/BufferStream.h : 56
muduo-1.0.8/muduo/net/protobuf/ProtobufCodecLite.h : 205
muduo-1.0.8/muduo/net/inspect/SystemInspector.cc : 134
muduo-1.0.8/muduo/net/inspect/Inspector.h : 70
muduo-1.0.8/muduo/net/inspect/PerformanceInspector.h : 41
muduo-1.0.8/muduo/net/inspect/ProcessInspector.cc : 240
muduo-1.0.8/muduo/net/inspect/Inspector.cc : 385
muduo-1.0.8/muduo/net/inspect/SystemInspector.h : 37
muduo-1.0.8/muduo/net/inspect/PerformanceInspector.cc : 104
muduo-1.0.8/muduo/net/inspect/ProcessInspector.h : 39
muduo-1.0.8/muduo/net/protorpc/RpcServer.h : 57
muduo-1.0.8/muduo/net/protorpc/google-inl.h : 84
muduo-1.0.8/muduo/net/protorpc/RpcServer.cc : 70
muduo-1.0.8/muduo/net/protorpc/RpcCodec.cc : 39
muduo-1.0.8/muduo/net/protorpc/RpcCodec.h : 49
muduo-1.0.8/muduo/net/protorpc/RpcChannel.cc : 187
muduo-1.0.8/muduo/net/protorpc/RpcChannel.h : 154
muduo-1.0.8/muduo/net/poller/EPollPoller.cc : 209
muduo-1.0.8/muduo/net/poller/DefaultPoller.cc : 27
muduo-1.0.8/muduo/net/poller/EPollPoller.h : 55
muduo-1.0.8/muduo/net/poller/PollPoller.cc : 142
muduo-1.0.8/muduo/net/poller/PollPoller.h : 49
total line num = 12796 filenum = 109

这个库的所有核心代码,总共大概也就在12796行。代码规模比较小,方便我们研读与掌握。

libevent

项目主页:http://libevent.org/

大名鼎鼎的libevent。它是一个用C语言编写的、轻量级的开源高性能网络库,它的主要亮点即是事件驱动(event-driven),高性能,轻量级。它支持Windows、 Linux、 *BSD 和 Mac Os等多个不同的平台。支持多种 I/O 多路复用技术, epoll、 poll、 dev/poll、 select 和 kqueue 等;支持 I/O,定时器和信号等事件;注册事件优先级。

当前这个库已经被用在了Chromium、Memcached、Transmission和Tor等众多非常成功的开源项目中了。

它的代码相当精炼、易读,因而也是我们学习网络编程一份不可多得的好材料。

libevent-2.0.22-stable/bufferevent_sock.c : 699
libevent-2.0.22-stable/log-internal.h : 59
libevent-2.0.22-stable/bufferevent_openssl.c : 1454
libevent-2.0.22-stable/strlcpy-internal.h : 21
libevent-2.0.22-stable/bufferevent-internal.h : 410
libevent-2.0.22-stable/evhttp.h : 45
libevent-2.0.22-stable/autogen.sh : 15
libevent-2.0.22-stable/buffer_iocp.c : 325
libevent-2.0.22-stable/event.h : 85
libevent-2.0.22-stable/evmap.c : 799
libevent-2.0.22-stable/bufferevent_ratelim.c : 1011
libevent-2.0.22-stable/evthread-internal.h : 382
libevent-2.0.22-stable/ltmain.sh : 9655
libevent-2.0.22-stable/log.c : 224
libevent-2.0.22-stable/http.c : 4529
libevent-2.0.22-stable/epoll.c : 473
libevent-2.0.22-stable/changelist-internal.h : 101
libevent-2.0.22-stable/signal.c : 445
libevent-2.0.22-stable/minheap-internal.h : 160
libevent-2.0.22-stable/event-internal.h : 368
libevent-2.0.22-stable/strlcpy.c : 74
libevent-2.0.22-stable/evthread_pthread.c : 189
libevent-2.0.22-stable/buffer.c : 3122
libevent-2.0.22-stable/evport.c : 473
libevent-2.0.22-stable/event_tagging.c : 596
libevent-2.0.22-stable/listener.c : 886
libevent-2.0.22-stable/evdns.c : 4675
libevent-2.0.22-stable/select.c : 333
libevent-2.0.22-stable/iocp-internal.h : 201
libevent-2.0.22-stable/bufferevent.c : 875
libevent-2.0.22-stable/mm-internal.h : 61
libevent-2.0.22-stable/event_iocp.c : 293
libevent-2.0.22-stable/event_rpcgen.py : 1717
libevent-2.0.22-stable/install-sh : 527
libevent-2.0.22-stable/evrpc.c : 1174
libevent-2.0.22-stable/evutil.c : 2190
libevent-2.0.22-stable/evthread.c : 445
libevent-2.0.22-stable/ratelim-internal.h : 105
libevent-2.0.22-stable/evbuffer-internal.h : 293
libevent-2.0.22-stable/kqueue.c : 475
libevent-2.0.22-stable/defer-internal.h : 100
libevent-2.0.22-stable/poll.c : 333
libevent-2.0.22-stable/devpoll.c : 306
libevent-2.0.22-stable/util-internal.h : 329
libevent-2.0.22-stable/ipv6-internal.h : 81
libevent-2.0.22-stable/ht-internal.h : 484
libevent-2.0.22-stable/evrpc.h : 45
libevent-2.0.22-stable/evmap-internal.h : 92
libevent-2.0.22-stable/evsignal-internal.h : 64
libevent-2.0.22-stable/arc4random.c : 555
libevent-2.0.22-stable/bufferevent_pair.c : 334
libevent-2.0.22-stable/config.h : 443
libevent-2.0.22-stable/epoll_sub.c : 65
libevent-2.0.22-stable/bufferevent_async.c : 690
libevent-2.0.22-stable/evrpc-internal.h : 204
libevent-2.0.22-stable/event.c : 2943
libevent-2.0.22-stable/bufferevent_filter.c : 511
libevent-2.0.22-stable/evutil_rand.c : 180
libevent-2.0.22-stable/evdns.h : 45
libevent-2.0.22-stable/http-internal.h : 195
libevent-2.0.22-stable/evutil.h : 39
libevent-2.0.22-stable/WIN32-Code/tree.h : 1354
libevent-2.0.22-stable/include/event2/bufferevent_compat.h : 100
libevent-2.0.22-stable/include/event2/dns_compat.h : 336
libevent-2.0.22-stable/include/event2/event_compat.h : 220
libevent-2.0.22-stable/include/event2/event.h : 1204
libevent-2.0.22-stable/include/event2/http.h : 863
libevent-2.0.22-stable/include/event2/http_struct.h : 130
libevent-2.0.22-stable/include/event2/rpc_struct.h : 100
libevent-2.0.22-stable/include/event2/http_compat.h : 90
libevent-2.0.22-stable/include/event2/rpc_compat.h : 61
libevent-2.0.22-stable/include/event2/util.h : 713
libevent-2.0.22-stable/include/event2/keyvalq_struct.h : 80
libevent-2.0.22-stable/include/event2/tag_compat.h : 49
libevent-2.0.22-stable/include/event2/event_struct.h : 141
libevent-2.0.22-stable/include/event2/rpc.h : 596
libevent-2.0.22-stable/include/event2/bufferevent_struct.h : 116
libevent-2.0.22-stable/include/event2/bufferevent_ssl.h : 107
libevent-2.0.22-stable/include/event2/event-config.h : 458
libevent-2.0.22-stable/include/event2/tag.h : 124
libevent-2.0.22-stable/include/event2/bufferevent.h : 821
libevent-2.0.22-stable/include/event2/listener.h : 143
libevent-2.0.22-stable/include/event2/buffer_compat.h : 110
libevent-2.0.22-stable/include/event2/dns.h : 643
libevent-2.0.22-stable/include/event2/thread.h : 236
libevent-2.0.22-stable/include/event2/buffer.h : 842
libevent-2.0.22-stable/include/event2/dns_struct.h : 80
libevent-2.0.22-stable/WIN32-Code/event2/event-config.h : 363
libevent-2.0.22-stable/compat/sys/queue.h : 488
total line num = 58570 filenum = 89

这个项目的核心代码接近6W行,相对libev和muduo还是要多不少,为了跨平台嘛,难免要多很多东西。

libuv

项目主页:http://docs.libuv.org/en

Github主页:https://github.com/libuv/libuv

这是一个与libev、libevent类似的网络IO库。node.js的作者封装的一个事件库。*NIX的部分实现基于libev来做,而windows的部分则为自己封装的。但这个项目在libev的基础之上还是做了不少优化的。具体这个库与libev的差别,可以参考CSDN上的一篇文章 libev和libuv的区别

libuv-1.8.0/autogen.sh : 46
libuv-1.8.0/checksparse.sh : 234
libuv-1.8.0/gyp_uv.py : 93
libuv-1.8.0/src/uv-common.h : 227
libuv-1.8.0/src/version.c : 45
libuv-1.8.0/src/threadpool.c : 303
libuv-1.8.0/src/uv-common.c : 627
libuv-1.8.0/src/fs-poll.c : 255
libuv-1.8.0/src/inet.c : 309
libuv-1.8.0/src/heap-inl.h : 245
libuv-1.8.0/src/queue.h : 108
libuv-1.8.0/include/stdint-msvc2008.h : 247
libuv-1.8.0/include/pthread-fixes.h : 72
libuv-1.8.0/include/uv-unix.h : 383
libuv-1.8.0/include/uv-threadpool.h : 37
libuv-1.8.0/include/android-ifaddrs.h : 54
libuv-1.8.0/include/uv-version.h : 43
libuv-1.8.0/include/uv.h : 1482
libuv-1.8.0/include/uv-linux.h : 34
libuv-1.8.0/include/uv-errno.h : 418
libuv-1.8.0/include/uv-sunos.h : 44
libuv-1.8.0/include/uv-aix.h : 32
libuv-1.8.0/include/uv-bsd.h : 34
libuv-1.8.0/include/tree.h : 768
libuv-1.8.0/src/unix/core.c : 1104
libuv-1.8.0/src/unix/stream.c : 1615
libuv-1.8.0/src/unix/thread.c : 525
libuv-1.8.0/src/unix/freebsd.c : 450
libuv-1.8.0/src/unix/atomic-ops.h : 77
libuv-1.8.0/src/unix/tcp.c : 362
libuv-1.8.0/src/unix/process.c : 563
libuv-1.8.0/src/unix/fsevents.c : 904
libuv-1.8.0/src/unix/signal.c : 467
libuv-1.8.0/src/unix/spinlock.h : 53
libuv-1.8.0/src/unix/loop.c : 155
libuv-1.8.0/src/unix/dl.c : 80
libuv-1.8.0/src/unix/proctitle.c : 102
libuv-1.8.0/src/unix/internal.h : 316
libuv-1.8.0/src/unix/linux-syscalls.h : 158
libuv-1.8.0/src/unix/async.c : 290
libuv-1.8.0/src/unix/linux-syscalls.c : 471
libuv-1.8.0/src/unix/tty.c : 279
libuv-1.8.0/src/unix/linux-inotify.c : 285
libuv-1.8.0/src/unix/sunos.c : 765
libuv-1.8.0/src/unix/netbsd.c : 370
libuv-1.8.0/src/unix/aix.c : 1158
libuv-1.8.0/src/unix/getnameinfo.c : 120
libuv-1.8.0/src/unix/openbsd.c : 386
libuv-1.8.0/src/unix/kqueue.c : 426
libuv-1.8.0/src/unix/loop-watcher.c : 68
libuv-1.8.0/src/unix/android-ifaddrs.c : 703
libuv-1.8.0/src/unix/poll.c : 113
libuv-1.8.0/src/unix/udp.c : 873
libuv-1.8.0/src/unix/linux-core.c : 899
libuv-1.8.0/src/unix/getaddrinfo.c : 202
libuv-1.8.0/src/unix/pthread-fixes.c : 104
libuv-1.8.0/src/unix/timer.c : 172
libuv-1.8.0/src/unix/fs.c : 1310
libuv-1.8.0/src/unix/pipe.c : 288
libuv-1.8.0/docs/src/conf.py : 348
libuv-1.8.0/docs/src/sphinx-plugins/manpage.py : 46
total line num = 22747 filenum = 61

总体来看,代码规模不是很大。作为node.js的核心库,相信质量是很高的。想对于libev和libevent的诸多优点,因而也很值得我们一番细致研读。

memcached

项目主页:http://memcached.org/

Github主页:https://github.com/memcached/memcached

Memcached是一个高性能的分布式内存对象缓存系统,用于动态Web应用以减轻数据库负载。它通过在内存中缓存数据和对象来减少读取数据库的次数,从而提高动态、数据库驱动网站的速度。Memcached基于一个存储键/值对的hashmap。其守护进程(daemon )是用C写的,但是客户端可以用任何语言来编写,并通过memcached协议与守护进程通信。

memcached/trace.h : 71
memcached/thread.c : 802
memcached/timedrun.c : 102
memcached/autogen.sh : 52
memcached/sasl_defs.h : 31
memcached/slabs.c : 978
memcached/protocol_binary.h : 470
memcached/cache.c : 148
memcached/cache.h : 116
memcached/murmur3_hash.h : 19
memcached/daemon.c : 89
memcached/murmur3_hash.c : 124
memcached/hash.c : 21
memcached/stats.h : 8
memcached/globals.c : 25
memcached/stats.c : 375
memcached/util.h : 33
memcached/memcached.h : 625
memcached/memcached.c : 5793
memcached/util.c : 144
memcached/slabs.h : 53
memcached/assoc.h : 10
memcached/jenkins_hash.h : 15
memcached/version.sh : 11
memcached/jenkins_hash.c : 431
memcached/solaris_priv.c : 44
memcached/sizes.c : 29
memcached/hash.h : 14
memcached/sasl_defs.c : 190
memcached/assoc.c : 306
memcached/items.c : 1492
memcached/items.h : 46
total line num = 12667 filenum = 32

这个项目代码量不大,整体清晰简洁,代码质量非常高。因而很值得我们研读。

Redis

项目主页:http://redis.io/

Redis是一个开源的使用ANSI C语言编写、支持网络、可基于内存亦可持久化的日志型、Key-Value数据库,并提供多种语言的API。从2010年3月15日起,Redis的开发工作由VMware主持。从2013年5月开始,Redis的开发由Pivotal赞助。

redis-3.0.7/src/rio.h : 139
redis-3.0.7/src/crc16.c : 88
redis-3.0.7/src/sds.h : 101
redis-3.0.7/src/replication.c : 2349
redis-3.0.7/src/ziplist.h : 46
redis-3.0.7/src/sentinel.c : 3959
redis-3.0.7/src/config.c : 1929
redis-3.0.7/src/redis-benchmark.c : 811
redis-3.0.7/src/rio.c : 350
redis-3.0.7/src/redis-check-dump.c : 771
redis-3.0.7/src/ae_epoll.c : 137
redis-3.0.7/src/mkreleasehdr.sh : 11
redis-3.0.7/src/db.c : 1247
redis-3.0.7/src/zmalloc.h : 86
redis-3.0.7/src/release.c : 52
redis-3.0.7/src/pqsort.c : 185
redis-3.0.7/src/object.c : 739
redis-3.0.7/src/sha1.c : 226
redis-3.0.7/src/slowlog.c : 169
redis-3.0.7/src/version.h : 1
redis-3.0.7/src/multi.c : 323
redis-3.0.7/src/rand.c : 93
redis-3.0.7/src/aof.c : 1506
redis-3.0.7/src/networking.c : 1780
redis-3.0.7/src/t_zset.c : 2918
redis-3.0.7/src/ae_kqueue.c : 138
redis-3.0.7/src/lzf_c.c : 295
redis-3.0.7/src/rand.h : 38
redis-3.0.7/src/t_string.c : 457
redis-3.0.7/src/cluster.h : 261
redis-3.0.7/src/lzfP.h : 159
redis-3.0.7/src/latency.c : 623
redis-3.0.7/src/ae.c : 465
redis-3.0.7/src/pqsort.h : 40
redis-3.0.7/src/asciilogo.h : 47
redis-3.0.7/src/zipmap.c : 465
redis-3.0.7/src/redis.h : 1584
redis-3.0.7/src/crc64.c : 191
redis-3.0.7/src/anet.h : 75
redis-3.0.7/src/ae.h : 120
redis-3.0.7/src/redis-check-aof.c : 218
redis-3.0.7/src/bio.c : 220
redis-3.0.7/src/util.h : 45
redis-3.0.7/src/redisassert.h : 47
redis-3.0.7/src/fmacros.h : 61
redis-3.0.7/src/endianconv.c : 124
redis-3.0.7/src/intset.h : 50
redis-3.0.7/src/adlist.c : 341
redis-3.0.7/src/util.c : 689
redis-3.0.7/src/rdb.h : 115
redis-3.0.7/src/debug.c : 970
redis-3.0.7/src/redis.c : 3711
redis-3.0.7/src/ae_evport.c : 320
redis-3.0.7/src/dict.c : 1125
redis-3.0.7/src/ziplist.c : 1536
redis-3.0.7/src/t_set.c : 919
redis-3.0.7/src/sort.c : 568
redis-3.0.7/src/dict.h : 185
redis-3.0.7/src/bio.h : 41
redis-3.0.7/src/t_hash.c : 771
redis-3.0.7/src/help.h : 1002
redis-3.0.7/src/endianconv.h : 74
redis-3.0.7/src/sparkline.c : 176
redis-3.0.7/src/solarisfixes.h : 54
redis-3.0.7/src/sds.c : 1106
redis-3.0.7/src/lzf_d.c : 150
redis-3.0.7/src/slowlog.h : 47
redis-3.0.7/src/intset.c : 483
redis-3.0.7/src/blocked.c : 183
redis-3.0.7/src/setproctitle.c : 261
redis-3.0.7/src/lzf.h : 100
redis-3.0.7/src/zmalloc.c : 366
redis-3.0.7/src/rdb.c : 1562
redis-3.0.7/src/sha1.h : 17
redis-3.0.7/src/ae_select.c : 105
redis-3.0.7/src/zipmap.h : 49
redis-3.0.7/src/bitops.c : 600
redis-3.0.7/src/config.h : 204
redis-3.0.7/src/latency.h : 93
redis-3.0.7/src/crc64.h : 8
redis-3.0.7/src/adlist.h : 93
redis-3.0.7/src/pubsub.c : 371
redis-3.0.7/src/anet.c : 630
redis-3.0.7/src/syncio.c : 145
redis-3.0.7/src/scripting.c : 1202
redis-3.0.7/src/cluster.c : 5159
redis-3.0.7/src/hyperloglog.c : 1556
redis-3.0.7/src/notify.c : 130
redis-3.0.7/src/redis-cli.c : 2303
redis-3.0.7/src/t_list.c : 1119
redis-3.0.7/src/sparkline.h : 56
total line num = 56434 filenum = 91

总的核心代码量大概接近6W。同样值得我们研读。

RxJava

Github主页:https://github.com/ReactiveX/RxJava

RxJava/src/perf/java/rx/ObservablePerfBaseline.java : 82
RxJava/src/perf/java/rx/SinglePerfBaseline.java : 100
RxJava/src/main/java/rx/Subscriber.java : 215
RxJava/src/main/java/rx/SingleSubscriber.java : 85
RxJava/src/main/java/rx/Subscription.java : 45
RxJava/src/main/java/rx/Observer.java : 63
RxJava/src/main/java/rx/package-info.java : 44
RxJava/src/main/java/rx/Scheduler.java : 152
RxJava/src/main/java/rx/Single.java : 1901
RxJava/src/main/java/rx/Producer.java : 42
RxJava/src/main/java/rx/Observable.java : 10080
RxJava/src/main/java/rx/Notification.java : 212
RxJava/src/perf/java/rx/subjects/ReplaySubjectPerf.java : 119
RxJava/src/perf/java/rx/operators/OperatorFlatMapPerf.java : 103
RxJava/src/perf/java/rx/operators/FromIterablePerf.java : 85
RxJava/src/perf/java/rx/operators/OperatorMergePerf.java : 169
RxJava/src/perf/java/rx/operators/OperatorPublishPerf.java : 135
RxJava/src/perf/java/rx/operators/OperatorSerializePerf.java : 135
RxJava/src/perf/java/rx/operators/OperatorMapPerf.java : 69
RxJava/src/perf/java/rx/operators/OperatorObserveOnPerf.java : 91
RxJava/src/perf/java/rx/operators/OperatorRangePerf.java : 122
RxJava/src/perf/java/rx/operators/OperatorTakeLastOnePerf.java : 39
RxJava/src/perf/java/rx/schedulers/IOSchedulerPerf.java : 62
RxJava/src/perf/java/rx/schedulers/ComputationSchedulerPerf.java : 62
RxJava/src/perf/java/rx/internal/IndexedRingBufferPerf.java : 66
RxJava/src/perf/java/rx/internal/RxRingBufferPerf.java : 141
RxJava/src/perf/java/rx/internal/AtomicPerf.java : 280
RxJava/src/perf/java/rx/jmh/LatchedObserver.java : 48
RxJava/src/perf/java/rx/jmh/InputWithIncrementingInteger.java : 128
RxJava/src/perf/java/rx/subscriptions/SubscriptionListPerf.java : 89
RxJava/src/perf/java/rx/subscriptions/SubscriptionListConcurrentPerf.java : 131
RxJava/src/perf/java/rx/subscriptions/CompositeSubscriptionPerf.java : 118
RxJava/src/perf/java/rx/subscriptions/CompositeSubscriptionConcurrentPerf.java : 198
RxJava/src/perf/java/rx/subscriptions/SerialSubscriptionPerf.java : 86
RxJava/src/perf/java/rx/subscriptions/MultipleAssignmentSubscriptionPerf.java : 86
RxJava/src/perf/java/rx/observables/MultiInput.java : 36
RxJava/src/perf/java/rx/observables/BlockingObservablePerf.java : 47
RxJava/src/perf/java/rx/observables/SingleInput.java : 36
RxJava/src/perf/java/rx/observables/SyncOnSubscribePerf.java : 118
RxJava/src/main/java/rx/subjects/TestSubject.java : 175
RxJava/src/main/java/rx/subjects/SerializedSubject.java : 143
RxJava/src/main/java/rx/subjects/SubjectSubscriptionManager.java : 341
RxJava/src/main/java/rx/subjects/BehaviorSubject.java : 257
RxJava/src/main/java/rx/subjects/PublishSubject.java : 202
RxJava/src/main/java/rx/subjects/Subject.java : 174
RxJava/src/main/java/rx/subjects/ReplaySubject.java : 1171
RxJava/src/main/java/rx/subjects/AsyncSubject.java : 226
RxJava/src/main/java/rx/annotations/Beta.java : 51
RxJava/src/main/java/rx/annotations/Experimental.java : 41
RxJava/src/main/java/rx/plugins/RxJavaErrorHandler.java : 107
RxJava/src/main/java/rx/plugins/RxJavaPlugins.java : 214
RxJava/src/main/java/rx/plugins/RxJavaObservableExecutionHookDefault.java : 29
RxJava/src/main/java/rx/plugins/RxJavaObservableExecutionHook.java : 121
RxJava/src/main/java/rx/plugins/RxJavaSchedulersHook.java : 85
RxJava/src/main/java/rx/observers/Observers.java : 191
RxJava/src/main/java/rx/observers/SerializedSubscriber.java : 97
RxJava/src/main/java/rx/observers/Subscribers.java : 239
RxJava/src/main/java/rx/observers/TestObserver.java : 180
RxJava/src/main/java/rx/observers/SerializedObserver.java : 185
RxJava/src/main/java/rx/observers/SafeSubscriber.java : 213
RxJava/src/main/java/rx/observers/TestSubscriber.java : 506
RxJava/src/main/java/rx/schedulers/ImmediateScheduler.java : 74
RxJava/src/main/java/rx/schedulers/Schedulers.java : 189
RxJava/src/main/java/rx/schedulers/TrampolineScheduler.java : 135
RxJava/src/main/java/rx/schedulers/TimeInterval.java : 96
RxJava/src/main/java/rx/schedulers/CachedThreadScheduler.java : 237
RxJava/src/main/java/rx/schedulers/ExecutorScheduler.java : 179
RxJava/src/main/java/rx/schedulers/package-info.java : 19
RxJava/src/main/java/rx/schedulers/SleepingAction.java : 55
RxJava/src/main/java/rx/schedulers/TestScheduler.java : 180
RxJava/src/main/java/rx/schedulers/Timestamped.java : 86
RxJava/src/main/java/rx/schedulers/NewThreadScheduler.java : 43
RxJava/src/main/java/rx/subscriptions/Subscriptions.java : 135
RxJava/src/main/java/rx/subscriptions/BooleanSubscription.java : 77
RxJava/src/main/java/rx/subscriptions/RefCountSubscription.java : 147
RxJava/src/main/java/rx/subscriptions/MultipleAssignmentSubscription.java : 104
RxJava/src/main/java/rx/subscriptions/CompositeSubscription.java : 168
RxJava/src/main/java/rx/subscriptions/SerialSubscription.java : 105
RxJava/src/main/java/rx/observables/AsyncOnSubscribe.java : 663
RxJava/src/main/java/rx/observables/AbstractOnSubscribe.java : 625
RxJava/src/main/java/rx/observables/SyncOnSubscribe.java : 473
RxJava/src/main/java/rx/observables/ConnectableObservable.java : 134
RxJava/src/main/java/rx/observables/GroupedObservable.java : 105
RxJava/src/main/java/rx/observables/BlockingObservable.java : 700
RxJava/src/main/java/rx/exceptions/OnCompletedFailedException.java : 29
RxJava/src/main/java/rx/exceptions/OnErrorNotImplementedException.java : 58
RxJava/src/main/java/rx/exceptions/MissingBackpressureException.java : 58
RxJava/src/main/java/rx/exceptions/OnErrorFailedException.java : 50
RxJava/src/main/java/rx/exceptions/OnErrorThrowable.java : 197
RxJava/src/main/java/rx/exceptions/UnsubscribeFailedException.java : 30
RxJava/src/main/java/rx/exceptions/Exceptions.java : 206
RxJava/src/main/java/rx/exceptions/CompositeException.java : 266
RxJava/src/main/java/rx/functions/Action1.java : 23
RxJava/src/main/java/rx/functions/Action0.java : 23
RxJava/src/main/java/rx/functions/Actions.java : 432
RxJava/src/main/java/rx/functions/Action2.java : 23
RxJava/src/main/java/rx/functions/ActionN.java : 23
RxJava/src/main/java/rx/functions/FuncN.java : 23
RxJava/src/main/java/rx/functions/Func0.java : 26
RxJava/src/main/java/rx/functions/Action6.java : 24
RxJava/src/main/java/rx/functions/Func2.java : 23
RxJava/src/main/java/rx/functions/Func4.java : 23
RxJava/src/main/java/rx/functions/Action7.java : 23
RxJava/src/main/java/rx/functions/Action5.java : 24
RxJava/src/main/java/rx/functions/Func1.java : 23
RxJava/src/main/java/rx/functions/Action3.java : 23
RxJava/src/main/java/rx/functions/Func3.java : 23
RxJava/src/main/java/rx/functions/Functions.java : 333
RxJava/src/main/java/rx/functions/Action9.java : 23
RxJava/src/main/java/rx/functions/Func9.java : 23
RxJava/src/main/java/rx/functions/Func5.java : 23
RxJava/src/main/java/rx/functions/Func7.java : 23
RxJava/src/main/java/rx/functions/Action8.java : 23
RxJava/src/main/java/rx/functions/Func6.java : 23
RxJava/src/main/java/rx/functions/Function.java : 25
RxJava/src/main/java/rx/functions/Func8.java : 23
RxJava/src/main/java/rx/functions/Action4.java : 24
RxJava/src/main/java/rx/functions/Action.java : 25
RxJava/src/main/java/rx/internal/operators/OperatorDistinct.java : 83
RxJava/src/main/java/rx/internal/operators/OperatorTakeUntilPredicate.java : 98
RxJava/src/main/java/rx/internal/operators/OperatorTakeTimed.java : 84
RxJava/src/main/java/rx/internal/operators/OperatorTimeout.java : 59
RxJava/src/main/java/rx/internal/operators/OperatorMapPair.java : 95
RxJava/src/main/java/rx/internal/operators/OperatorTakeLastOne.java : 174
RxJava/src/main/java/rx/internal/operators/TakeLastQueueProducer.java : 128
RxJava/src/main/java/rx/internal/operators/OperatorWindowWithSize.java : 263
RxJava/src/main/java/rx/internal/operators/OnSubscribeFromIterable.java : 139
RxJava/src/main/java/rx/internal/operators/OperatorCast.java : 57
RxJava/src/main/java/rx/internal/operators/NotificationLite.java : 246
RxJava/src/main/java/rx/internal/operators/OperatorSwitchIfEmpty.java : 125
RxJava/src/main/java/rx/internal/operators/OperatorWindowWithObservable.java : 295
RxJava/src/main/java/rx/internal/operators/OnSubscribeTimerPeriodically.java : 64
RxJava/src/main/java/rx/internal/operators/OperatorAsObservable.java : 46
RxJava/src/main/java/rx/internal/operators/OperatorWindowWithTime.java : 499
RxJava/src/main/java/rx/internal/operators/OperatorFinally.java : 68
RxJava/src/main/java/rx/internal/operators/OperatorSkipUntil.java : 92
RxJava/src/main/java/rx/internal/operators/OnSubscribeAmb.java : 445
RxJava/src/main/java/rx/internal/operators/OperatorSkipLast.java : 79
RxJava/src/main/java/rx/internal/operators/OperatorMap.java : 64
RxJava/src/main/java/rx/internal/operators/OperatorMaterialize.java : 168
RxJava/src/main/java/rx/internal/operators/OnSubscribeDefer.java : 54
RxJava/src/main/java/rx/internal/operators/OperatorZipIterable.java : 79
RxJava/src/main/java/rx/internal/operators/OperatorScan.java : 375
RxJava/src/main/java/rx/internal/operators/OperatorBufferWithSize.java : 235
RxJava/src/main/java/rx/internal/operators/BlockingOperatorNext.java : 191
RxJava/src/main/java/rx/internal/operators/OperatorSampleWithTime.java : 112
RxJava/src/main/java/rx/internal/operators/OperatorMapNotification.java : 249
RxJava/src/main/java/rx/internal/operators/OnSubscribeTimerOnce.java : 59
RxJava/src/main/java/rx/internal/operators/OperatorConcat.java : 233
RxJava/src/main/java/rx/internal/operators/OperatorSerialize.java : 58
RxJava/src/main/java/rx/internal/operators/OperatorDoOnSubscribe.java : 45
RxJava/src/main/java/rx/internal/operators/OperatorToMultimap.java : 142
RxJava/src/main/java/rx/internal/operators/OperatorSequenceEqual.java : 89
RxJava/src/main/java/rx/internal/operators/OperatorSampleWithObservable.java : 95
RxJava/src/main/java/rx/internal/operators/OperatorOnBackpressureDrop.java : 95
RxJava/src/main/java/rx/internal/operators/CachedObservable.java : 455
RxJava/src/main/java/rx/internal/operators/OperatorAll.java : 78
RxJava/src/main/java/rx/internal/operators/OperatorGroupBy.java : 429
RxJava/src/main/java/rx/internal/operators/OnSubscribeToObservableFuture.java : 99
RxJava/src/main/java/rx/internal/operators/OperatorTakeWhile.java : 93
RxJava/src/main/java/rx/internal/operators/OperatorBufferWithSingleObservable.java : 193
RxJava/src/main/java/rx/internal/operators/OperatorTimeoutWithSelector.java : 112
RxJava/src/main/java/rx/internal/operators/OperatorZip.java : 338
RxJava/src/main/java/rx/internal/operators/OperatorBufferWithStartEndObservable.java : 218
RxJava/src/main/java/rx/internal/operators/OperatorUnsubscribeOn.java : 78
RxJava/src/main/java/rx/internal/operators/OperatorWindowWithObservableFactory.java : 320
RxJava/src/main/java/rx/internal/operators/OnSubscribeRefCount.java : 168
RxJava/src/main/java/rx/internal/operators/OperatorDebounceWithTime.java : 182
RxJava/src/main/java/rx/internal/operators/OperatorSkipLastTimed.java : 79
RxJava/src/main/java/rx/internal/operators/OperatorOnErrorReturn.java : 111
RxJava/src/main/java/rx/internal/operators/OperatorTakeUntil.java : 97
RxJava/src/main/java/rx/internal/operators/OperatorReplay.java : 1194
RxJava/src/main/java/rx/internal/operators/OperatorTimeoutBase.java : 177
RxJava/src/main/java/rx/internal/operators/BlockingOperatorMostRecent.java : 129
RxJava/src/main/java/rx/internal/operators/OperatorTakeLast.java : 82
RxJava/src/main/java/rx/internal/operators/OperatorToMap.java : 109
RxJava/src/main/java/rx/internal/operators/OperatorTimeInterval.java : 60
RxJava/src/main/java/rx/internal/operators/BackpressureUtils.java : 106
RxJava/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaObservable.java : 104
RxJava/src/main/java/rx/internal/operators/OperatorElementAt.java : 117
RxJava/src/main/java/rx/internal/operators/OperatorSwitch.java : 291
RxJava/src/main/java/rx/internal/operators/OnSubscribeFromCallable.java : 38
RxJava/src/main/java/rx/internal/operators/OperatorTake.java : 136
RxJava/src/main/java/rx/internal/operators/OnSubscribeRedo.java : 372
RxJava/src/main/java/rx/internal/operators/OnSubscribeUsing.java : 136
RxJava/src/main/java/rx/internal/operators/OnSubscribeDelaySubscription.java : 59
RxJava/src/main/java/rx/internal/operators/OperatorDistinctUntilChanged.java : 87
RxJava/src/main/java/rx/internal/operators/OperatorIgnoreElements.java : 60
RxJava/src/main/java/rx/internal/operators/OperatorWindowWithStartEndObservable.java : 240
RxJava/src/main/java/rx/internal/operators/BlockingOperatorToIterator.java : 134
RxJava/src/main/java/rx/internal/operators/OnSubscribeGroupJoin.java : 381
RxJava/src/main/java/rx/internal/operators/OperatorDelay.java : 101
RxJava/src/main/java/rx/internal/operators/OperatorSingle.java : 144
RxJava/src/main/java/rx/internal/operators/OperatorToObservableSortedList.java : 119
RxJava/src/main/java/rx/internal/operators/OnSubscribeDelaySubscriptionWithSelector.java : 66
RxJava/src/main/java/rx/internal/operators/OperatorDebounceWithSelector.java : 108
RxJava/src/main/java/rx/internal/operators/OnSubscribeSingle.java : 89
RxJava/src/main/java/rx/internal/operators/OperatorObserveOn.java : 258
RxJava/src/main/java/rx/internal/operators/OperatorOnBackpressureBuffer.java : 172
RxJava/src/main/java/rx/internal/operators/OperatorOnErrorResumeNextViaFunction.java : 126
RxJava/src/main/java/rx/internal/operators/OperatorThrottleFirst.java : 68
RxJava/src/main/java/rx/internal/operators/BlockingOperatorToFuture.java : 137
RxJava/src/main/java/rx/internal/operators/OperatorTimestamp.java : 61
RxJava/src/main/java/rx/internal/operators/OperatorOnExceptionResumeNextViaObservable.java : 113
RxJava/src/main/java/rx/internal/operators/OperatorDoOnUnsubscribe.java : 47
RxJava/src/main/java/rx/internal/operators/OperatorDelayWithSelector.java : 81
RxJava/src/main/java/rx/internal/operators/OperatorSkip.java : 70
RxJava/src/main/java/rx/internal/operators/OperatorTakeLastTimed.java : 110
RxJava/src/main/java/rx/internal/operators/OnSubscribeJoin.java : 321
RxJava/src/main/java/rx/internal/operators/OperatorSkipWhile.java : 73
RxJava/src/main/java/rx/internal/operators/OperatorBufferWithTime.java : 309
RxJava/src/main/java/rx/internal/operators/OnSubscribeRange.java : 134
RxJava/src/main/java/rx/internal/operators/OperatorMulticast.java : 154
RxJava/src/main/java/rx/internal/operators/OperatorAny.java : 86
RxJava/src/main/java/rx/internal/operators/OperatorDoOnEach.java : 89
RxJava/src/main/java/rx/internal/operators/OperatorEagerConcatMap.java : 308
RxJava/src/main/java/rx/internal/operators/OperatorFilter.java : 67
RxJava/src/main/java/rx/internal/operators/BufferUntilSubscriber.java : 215
RxJava/src/main/java/rx/internal/operators/OperatorDematerialize.java : 87
RxJava/src/main/java/rx/internal/operators/OperatorRetryWithPredicate.java : 139
RxJava/src/main/java/rx/internal/operators/OnSubscribeAutoConnect.java : 57
RxJava/src/main/java/rx/internal/operators/OperatorDoOnRequest.java : 81
RxJava/src/main/java/rx/internal/operators/OperatorMerge.java : 827
RxJava/src/main/java/rx/internal/operators/OperatorSkipTimed.java : 80
RxJava/src/main/java/rx/internal/operators/OperatorSubscribeOn.java : 110
RxJava/src/main/java/rx/internal/operators/OperatorToObservableList.java : 115
RxJava/src/main/java/rx/internal/operators/OperatorOnBackpressureBlock.java : 95
RxJava/src/main/java/rx/internal/operators/OperatorPublish.java : 762
RxJava/src/main/java/rx/internal/schedulers/SchedulerLifecycle.java : 20
RxJava/src/main/java/rx/internal/schedulers/NewThreadWorker.java : 290
RxJava/src/main/java/rx/internal/schedulers/GenericScheduledExecutorService.java : 102
RxJava/src/main/java/rx/internal/schedulers/EventLoopsScheduler.java : 183
RxJava/src/main/java/rx/internal/schedulers/ScheduledAction.java : 202
RxJava/src/main/java/rx/internal/producers/ProducerObserverArbiter.java : 280
RxJava/src/main/java/rx/internal/producers/SingleDelayedProducer.java : 113
RxJava/src/main/java/rx/internal/producers/QueuedValueProducer.java : 136
RxJava/src/main/java/rx/internal/producers/SingleProducer.java : 78
RxJava/src/main/java/rx/internal/producers/ProducerArbiter.java : 191
RxJava/src/main/java/rx/internal/producers/QueuedProducer.java : 185
RxJava/src/main/java/rx/internal/util/SubscriptionRandomList.java : 155
RxJava/src/main/java/rx/internal/util/FrontPadding.java : 31
RxJava/src/main/java/rx/internal/util/PaddedAtomicInteger.java : 30
RxJava/src/main/java/rx/internal/util/SubscriptionIndexedRingBuffer.java : 145
RxJava/src/main/java/rx/internal/util/ObjectPool.java : 152
RxJava/src/main/java/rx/internal/util/ScalarSynchronousObservable.java : 151
RxJava/src/main/java/rx/internal/util/LinkedArrayList.java : 136
RxJava/src/main/java/rx/internal/util/BackpressureDrainManager.java : 240
RxJava/src/main/java/rx/internal/util/SynchronizedQueue.java : 168
RxJava/src/main/java/rx/internal/util/UtilityFunctions.java : 163
RxJava/src/main/java/rx/internal/util/IndexedRingBuffer.java : 536
RxJava/src/main/java/rx/internal/util/PaddedAtomicIntegerBase.java : 84
RxJava/src/main/java/rx/internal/util/SubscriptionList.java : 157
RxJava/src/main/java/rx/internal/util/RxRingBuffer.java : 457
RxJava/src/main/java/rx/internal/util/PlatformDependent.java : 89
RxJava/src/main/java/rx/internal/util/RxJavaPluginUtils.java : 40
RxJava/src/main/java/rx/internal/util/RxThreadFactory.java : 37
RxJava/src/main/java/rx/internal/util/SynchronizedSubscription.java : 35
RxJava/src/main/java/rx/internal/util/unsafe/SpscArrayQueue.java : 182
RxJava/src/main/java/rx/internal/util/unsafe/SpscLinkedQueue.java : 108
RxJava/src/main/java/rx/internal/util/unsafe/MpmcArrayQueue.java : 238
RxJava/src/main/java/rx/internal/util/unsafe/Pow2.java : 44
RxJava/src/main/java/rx/internal/util/unsafe/MessagePassingQueue.java : 74
RxJava/src/main/java/rx/internal/util/unsafe/ConcurrentCircularArrayQueue.java : 186
RxJava/src/main/java/rx/internal/util/unsafe/UnsafeAccess.java : 108
RxJava/src/main/java/rx/internal/util/unsafe/SpmcArrayQueue.java : 213
RxJava/src/main/java/rx/internal/util/unsafe/ConcurrentSequencedCircularArrayQueue.java : 58
RxJava/src/main/java/rx/internal/util/unsafe/MpscLinkedQueue.java : 136
RxJava/src/main/java/rx/internal/util/unsafe/BaseLinkedQueue.java : 126
RxJava/src/main/java/rx/internal/util/atomic/LinkedQueueNode.java : 57
RxJava/src/main/java/rx/internal/util/atomic/BaseLinkedAtomicQueue.java : 93
RxJava/src/main/java/rx/internal/util/atomic/MpscLinkedAtomicQueue.java : 126
RxJava/src/main/java/rx/internal/util/atomic/SpscLinkedAtomicQueue.java : 106
RxJava/src/main/java/rx/internal/util/atomic/SpscLinkedArrayQueue.java : 356
total line num = 53038 filenum = 273

这个项目中,对Java范型的应用真是出神入化,真的很值得一读。

stunserver-1.2.9

项目主页:http://www.stunprotocol.org/

stunserver,即STUNTMAN。这是一个STUN协议Server端的实现。如这个项目的主页中的说明,这个项目大概实现了5389,5769和5780这样几个RFC标准。

stunserver-1.2.9/common/stringhelper.h : 39
stunserver-1.2.9/common/stringhelper.cpp : 127
stunserver-1.2.9/common/objectfactory.h : 119
stunserver-1.2.9/common/cmdlineparser.h : 49
stunserver-1.2.9/common/atomichelpers.cpp : 79
stunserver-1.2.9/common/logger.h : 35
stunserver-1.2.9/common/logger.cpp : 56
stunserver-1.2.9/common/fasthash.cpp : 69
stunserver-1.2.9/common/prettyprint.cpp : 194
stunserver-1.2.9/common/atomichelpers.h : 27
stunserver-1.2.9/common/hresult.h : 63
stunserver-1.2.9/common/getconsolewidth.cpp : 49
stunserver-1.2.9/common/fasthash.h : 524
stunserver-1.2.9/common/chkmacros.h : 95
stunserver-1.2.9/common/common.cpp : 39
stunserver-1.2.9/common/cmdlineparser.cpp : 150
stunserver-1.2.9/common/refcountobject.cpp : 56
stunserver-1.2.9/common/oshelper.h : 28
stunserver-1.2.9/common/refcountobject.h : 212
stunserver-1.2.9/common/prettyprint.h : 22
stunserver-1.2.9/common/getmillisecondcounter.cpp : 40
stunserver-1.2.9/stuncore/stunbuilder.h : 88
stunserver-1.2.9/stuncore/datastream.h : 86
stunserver-1.2.9/stuncore/stuncore.h : 39
stunserver-1.2.9/stuncore/stunreader.cpp : 859
stunserver-1.2.9/stuncore/messagehandler.h : 107
stunserver-1.2.9/stuncore/stunclientlogic.h : 142
stunserver-1.2.9/stuncore/stunutils.h : 27
stunserver-1.2.9/stuncore/stunbuilder.cpp : 628
stunserver-1.2.9/stuncore/messagehandler.cpp : 465
stunserver-1.2.9/stuncore/datastream.cpp : 247
stunserver-1.2.9/stuncore/socketaddress.h : 86
stunserver-1.2.9/stuncore/socketrole.h : 48
stunserver-1.2.9/stuncore/stuntypes.h : 182
stunserver-1.2.9/stuncore/stunutils.cpp : 87
stunserver-1.2.9/stuncore/stunauth.h : 70
stunserver-1.2.9/stuncore/socketaddress.cpp : 367
stunserver-1.2.9/stuncore/stunreader.h : 121
stunserver-1.2.9/stuncore/buffer.cpp : 149
stunserver-1.2.9/stuncore/stunclientlogic.cpp : 249
stunserver-1.2.9/stuncore/buffer.h : 68
stunserver-1.2.9/server/stunconnection.cpp : 94
stunserver-1.2.9/server/tcpserver.cpp : 984
stunserver-1.2.9/server/server.cpp : 288
stunserver-1.2.9/server/server.h : 90
stunserver-1.2.9/server/stunconnection.h : 58
stunserver-1.2.9/server/tcpserver.h : 157
stunserver-1.2.9/server/main.cpp : 726
stunserver-1.2.9/server/stunsocketthread.h : 89
stunserver-1.2.9/server/stunsocketthread.cpp : 418
stunserver-1.2.9/networkutils/adapters.h : 32
stunserver-1.2.9/networkutils/adapters.cpp : 199
stunserver-1.2.9/networkutils/stunsocket.cpp : 332
stunserver-1.2.9/networkutils/ratelimiter.h : 69
stunserver-1.2.9/networkutils/polling.h : 59
stunserver-1.2.9/networkutils/stunsocket.h : 77
stunserver-1.2.9/networkutils/ratelimiter.cpp : 145
stunserver-1.2.9/networkutils/resolvehostname.h : 37
stunserver-1.2.9/networkutils/polling.cpp : 558
stunserver-1.2.9/networkutils/recvfromex.h : 26
stunserver-1.2.9/networkutils/resolvehostname.cpp : 96
stunserver-1.2.9/networkutils/recvfromex.cpp : 126
stunserver-1.2.9/resources/makecodefile.sh : 27
stunserver-1.2.9/client/clientmain.cpp : 670

total line num = 11544 filenum = 64

代码量也不是很大。

Corun

Github主页:https://github.com/coturn/coturn/

这个项目对于STUN/TURN/ICE等相关用于P2P系统的便准的实现比较齐全,因而代码量也略大。

coturn/src/ns_turn_defs.h : 254
coturn/src/server/ns_turn_maps.c : 1203
coturn/src/server/ns_turn_server.c : 4889
coturn/src/server/ns_turn_ioalib.h : 294
coturn/src/server/ns_turn_khash.h : 391
coturn/src/server/ns_turn_maps.h : 269
coturn/src/server/ns_turn_maps_rtcp.h : 81
coturn/src/server/ns_turn_maps_rtcp.c : 260
coturn/src/server/ns_turn_allocation.h : 237
coturn/src/server/ns_turn_allocation.c : 761
coturn/src/server/ns_turn_session.h : 176
coturn/src/server/ns_turn_server.h : 233
coturn/src/client++/TurnMsgLib.h : 1197
coturn/src/client/ns_turn_ioaddr.h : 108
coturn/src/client/ns_turn_msg_addr.h : 51
coturn/src/client/ns_turn_msg_defs_experimental.h : 57
coturn/src/client/ns_turn_msg_addr.c : 183
coturn/src/client/ns_turn_ioaddr.c : 551
coturn/src/client/ns_turn_msg.c : 2593
coturn/src/client/ns_turn_msg_defs.h : 266
coturn/src/client/ns_turn_msg.h : 228
coturn/src/apps/common/ns_turn_utils.c : 894
coturn/src/apps/common/hiredis_libevent2.h : 67
coturn/src/apps/common/ns_turn_utils.h : 89
coturn/src/apps/common/hiredis_libevent2.c : 385
coturn/src/apps/common/apputils.h : 249
coturn/src/apps/common/apputils.c : 1137
coturn/src/apps/common/stun_buffer.h : 132
coturn/src/apps/common/stun_buffer.c : 253
coturn/src/apps/uclient/startuclient.h : 87
coturn/src/apps/uclient/startuclient.c : 1629
coturn/src/apps/uclient/uclient.c : 1714
coturn/src/apps/uclient/mainuclient.c : 567
coturn/src/apps/uclient/session.h : 137
coturn/src/apps/uclient/uclient.h : 122
coturn/src/apps/relay/http_server.c : 379
coturn/src/apps/relay/ns_sm.h : 66
coturn/src/apps/relay/userdb.c : 1311
coturn/src/apps/relay/turn_admin_server.c : 3667
coturn/src/apps/relay/userdb.h : 223
coturn/src/apps/relay/turn_admin_server.h : 115
coturn/src/apps/relay/libtelnet.h : 677
coturn/src/apps/relay/mainrelay.c : 2673
coturn/src/apps/relay/tls_listener.c : 362
coturn/src/apps/relay/turn_ports.h : 73
coturn/src/apps/relay/ns_ioalib_impl.h : 322
coturn/src/apps/relay/libtelnet.c : 1545
coturn/src/apps/relay/turn_ports.c : 417
coturn/src/apps/relay/dtls_listener.h : 72
coturn/src/apps/relay/tls_listener.h : 63
coturn/src/apps/relay/http_server.h : 96
coturn/src/apps/relay/mainrelay.h : 366
coturn/src/apps/relay/dtls_listener.c : 1014
coturn/src/apps/relay/netengine.c : 1881
coturn/src/apps/relay/ns_ioalib_engine_impl.c : 3786
coturn/src/apps/rfc5769/rfc5769check.c : 573
coturn/src/apps/peer/udpserver.c : 172
coturn/src/apps/peer/mainudpserver.c : 102
coturn/src/apps/peer/udpserver.h : 76
coturn/src/apps/stunclient/stunclient.c : 466
coturn/src/apps/relay/dbdrivers/dbdriver.h : 92
coturn/src/apps/relay/dbdrivers/dbd_mongo.c : 1394
coturn/src/apps/relay/dbdrivers/dbd_mongo.h : 49
coturn/src/apps/relay/dbdrivers/dbd_mysql.c : 1261
coturn/src/apps/relay/dbdrivers/dbd_sqlite.h : 49
coturn/src/apps/relay/dbdrivers/dbd_redis.h : 49
coturn/src/apps/relay/dbdrivers/dbd_redis.c : 1392
coturn/src/apps/relay/dbdrivers/dbdriver.c : 113
coturn/src/apps/relay/dbdrivers/dbd_mysql.h : 49
coturn/src/apps/relay/dbdrivers/dbd_pgsql.h : 49
coturn/src/apps/relay/dbdrivers/dbd_pgsql.c : 994
coturn/src/apps/relay/dbdrivers/dbd_sqlite.c : 1341
total line num = 49073 filenum = 72

暂时想要好好研读的项目主要即是这些。

Done。

转载于:https://my.oschina.net/wolfcs/blog/649543

;