Пример #1
0
void CUTPSocketSession::Process()
{
	CSocketSession::Process();

	if(!IsValid())
		return;

	size_t ToGo = m_Sending.GetSize();
	if(ToGo)
		UTP_Write(m_Socket, ToGo);
}
Пример #2
0
int Socket::send(const char *buf, size_t len)
{
    if (len + outsize > MAXBUFFER) 
        len = MAXBUFFER - outsize;
    if (!len) return 0;
    char *newbuf = (char *)realloc((void *)outbuffer, len + outsize);
    if (newbuf == NULL) return -1;
    memcpy(newbuf + outsize, buf, len);
    outbuffer = newbuf;
    outsize += len;
    writable(UTP_Write(utp_sock, len));
    return len;
}