huoyu820125 / micro-development-kit Goto Github PK
View Code? Open in Web Editor NEW微量级的软件开发包,目前版本提供一个tcp nio框架和一些基础类
微量级的软件开发包,目前版本提供一个tcp nio框架和一些基础类
代码位置:
//数据写入缓冲
bool IOBuffer::WriteData( char *data, unsigned int nSize )
{
// 下面if和else都PrepareBuffer了,这里再PrepareBuffer是多余的,会造成内存泄漏
unsigned char *ioBuf = 0; // PrepareBuffer( nSize );
uint32 nSendSize = 0;
//数据加入发送缓冲,交给底层去发送
while ( true )
{
if ( nSize > BUFBLOCK_SIZE )
{
ioBuf = PrepareBuffer( BUFBLOCK_SIZE );
memcpy( ioBuf, &data[nSendSize], BUFBLOCK_SIZE );
WriteFinished( BUFBLOCK_SIZE );
nSendSize += BUFBLOCK_SIZE;
nSize -= BUFBLOCK_SIZE;
}
else
{
ioBuf = PrepareBuffer( nSize );
memcpy( ioBuf, &data[nSendSize], nSize );
WriteFinished( nSize );
break;
}
}
return true;
}
Windows Server 2003监听端口,客户端连接不上
NetHost::GetAddress() 取不到客户IP
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.