![]() |
ConstructTCPHeader() |
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
Protected Function |
Declared in: TCPCrafter.h |
virtual LPTCPHeader ConstructTCPHeader( unsigned short usSourcePort, unsigned short usDestinationPort, unsigned char ucHeaderLength) const;
Create the TCP header
try { //Create the initial header LPTCPHeader lpHead; lpHead=CTCPSocket::ConstructTCPHeader(usSourcePort, usDestinationPort, ucHeaderLength); if (!lpHead) { //Report it ReportError("ConstructTCPHeader","Received null TCP header!"); //Exit return NULL; } //Overide some data lpHead->usWindows=htons(m_usWindow); //Set the packet number lpHead->ulAcknowledgeNumber=htonl(m_uiAcknowledgeNumber); //And the sequence lpHead->ulSequenceNumber=htonl(m_uiSequenceNumber); //Data offset lpHead->ucDataOffset=m_ucDataOffset << 4; //Flags lpHead->ucFlags=m_ucFlags; //Urgent pointer lpHead->usUrgentPointer=htons(m_usUrgentPointer); //Return it to the user return lpHead; } ERROR_HANDLER_RETURN("ConstructTCPHeader",NULL)
![]() |
Site content copyright © 2003 Komodia LTD.. See the About page for additional notices. This page last updated: 24 Feb 2003. |