首页| JavaScript| HTML/CSS| Matlab| PHP| Python| Java| C/C++/VC++| C#| ASP| 其他|
购买积分 购买会员 激活码充值

您现在的位置是:虫虫源码 > 其他 > libmnet

libmnet

  • 资源大小:66.23 kB
  • 上传时间:2021-06-30
  • 下载次数:0次
  • 浏览次数:0次
  • 资源积分:1积分
  • 标      签:

资 源 简 介

Simple but robust networking library with async UDP sockets support. Underlying implementation uses Boost ASIO library in implementation. Why would I use this and not use Boost ASIO directly? Ease of use. mnet provides greatly simplified async UDP sockets usage. Working all-in-one client-server (run with "-server" command line argument to run as server): ``` include const char SERVER_ADDR[] = "localhost:12000"; using namespace mnet; class Ping : public PacketListener { public: IOService ios; UDPSocket socket; Ping( bool is_server ) : socket( ios, is_server ? Address(ios,SERVER_ADDR) : Address() ) { if (is_server) { socket.addPacketListener( this ); for (;;) ios.poll(); } else { char msg[128] = "Hello"; socket.send( Address(ios,SERVER_ADDR), msg, strlen(msg)+1 ); } } void onPacketReceived( const Address& remote,

文 件 列 表

build
vs2008
vs2010
documentation
mnet.chm
include
mnet
license.txt
readme.txt
samples
client-server
source
Address.cpp
IOService.cpp
UDPSocket.cpp
VIP VIP
0.191797s