Esempio n. 1
0
int SocketChannel::writeN(const RawBuffer &rb, const CommunicatioInformation &ci)
{
	MutexGuard mg(SessionManager::sockSendMuetx);
	
	SOCKADDR_IN addr = {0};
	int addrSize = sizeof(addr);
	addr.sin_family = AF_INET;
	addr.sin_port = ci.port;
	addr.sin_addr.S_un.S_addr = ci.hostAddress;

	return sendto(_sock.getHandle(), (char *)rb.getData(), rb.getLength(), 0, (sockaddr *)&addr, addrSize);
}
Esempio n. 2
0
HexBuffer::HexBuffer(const RawBuffer & rb)
{
	convert(rb.getData(), rb.getLength());
}
Esempio n. 3
0
int SocketChannel::writeN(const RawBuffer &rb)
{
	int result = send((SOCKET)_sock.getHandle(), (char *)rb.getData(), rb.getLength(), 0);
	return handleResultErrorResult(result);
}