![]() |
SendRawBuffer() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Public Function |
Declared in: SpoofSocket.h |
Declaration
virtual int SendRawBuffer(
IP aDestinationAddress,
const char* pBuffer,
unsigned long ulBufferLength,
unsigned short usDestinationPort);
DescriptionSend raw data Return value: Positive - The number of bytes sent. Negative - Error
Function Body
try
{
//Quit if not ok
//Make things the fastest
if (m_aSpoofSocket==INVALID_SOCKET ||
!m_bRaw)
return FALSE;
//Define the target address
sockaddr_in m_TargetAddress;
m_TargetAddress.sin_family=AF_INET;
m_TargetAddress.sin_addr.s_addr=aDestinationAddress;
m_TargetAddress.sin_port=htons(usDestinationPort);
memset(&m_TargetAddress.sin_zero,0,sizeof(m_TargetAddress.sin_zero));
//And send the data
//Send the data
int iResult;
iResult=sendto(GetHandle(),
pBuffer,
ulBufferLength,
0,
(sockaddr*)&m_TargetAddress,
sizeof(m_TargetAddress));
if (iResult==GetErrorCode())
//Set the error
SetLastError("SendRawBuffer");
//Done
return iResult;
}
ERROR_HANDLER_RETURN("SendRawBuffer",GetErrorCode())
See Also
This web site was generated
using Surveyor V4.50.811.1. Click
here
for more information. |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |