🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.nativeapi
Article #15696

Re: Raw sockets with winsock

#15696
From: "Kjartan T. Hjörvar"
Date: Mon, 16 Jun 2003 13:33
56 lines
3003 bytes
Hi

The program prints all its output on the console.
This is what is printed when the program is compiled with visual c

socketerror                 : 0
setsockopterror             : 0
sentbytes                   : 20
sendtoerror                 : 0

This is what is printed out when built with the builder (again on the
console).

socketerror                 : 0
setsockopterror             : 0
sentbytes                   : -1
sendtoerror                 : 10049

> Don't understand much of this. First you state that the IP header
> is 20 bytes. Then that they are the last four bytes. (Are they "6789" ? )
> The 20 bytes would be the packet too. See that you try to send an
> integer int on = 1; of 4 buytes.

Any IP header must be in total length 20 bytes (as per the RFC) of those
20 bytes the last 4 give the destination address, in this case "6789"
which must be translated into char to find the address the correspond
to. That address (most probably) not causing this trouble.

The packet I'm sending at the moment consists only of one 20 byte IP header.

>> The expected outcome was the result 0 in the first and second line, 
>> 20 in the third and 0 in the last.
> Sorry, about which lines are you speaking ?

the output on the console, see above

> I would think that the expected outcome would be "01234567890123456789".
> What comes out ?

When the output has -1 and 10049, no packet is sent over the net, else
the packet consisting only of the header "01234..." is sent.


>  > This implies that the opening of
>  > the socket and setting of the IP_HDRINCL option were successful 
> (first two)
>  > and 20 bytes were sent (last two).
> 
> ???? first two ? last two ?

Last two lines of the output to console.

Any ideas why this doesn't work ?

Kjartan T. Hjorvar
kjartant@simnet.is
Technical Details
Message-ID: <3eedc72b$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail
References: <3eebcb3d$1@newsgroups.borland.com> <3eec0f4d@newsgroups.borland.com> <3eed9e62$1@newsgroups.borland.com> <3eeda3b6@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 10cc67,37b140341e7bf2c2
X-Google-Attributes: gid10cc67,public
X-Google-ArrivalTime: 2003-06-16 06:39:15 PST
Date: Mon, 16 Jun 2003 13:33:33 +0000
From: "Kjartan T. Hjörvar" <kjartant@simnet.is>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.4) Gecko/20030529
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.nativeapi
Subject: Re: Raw sockets with winsock
References: <3eebcb3d$1@newsgroups.borland.com> <3eec0f4d@newsgroups.borland.com> <3eed9e62$1@newsgroups.borland.com> <3eeda3b6@newsgroups.borland.com>
In-Reply-To: <3eeda3b6@newsgroups.borland.com>
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 130.208.168.41
Message-ID: <3eedc72b$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1055770411 130.208.168.41 (16 Jun 2003 06:33:31 -0700)
Lines: 57
Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-06!sn-xit-08!supernews.com!newsfeed.wirehub.nl!news.kweb.on.ca!KWeb!newsgroups.borland.com!not-for-mail