Re: Is it possible to send a data segment with the FIN

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi again

I found the answer... I include it here for completion.

int on = 1 ;
setsockopt(fd, SOL_TCP, TCP_CORK, &on, sizeof(int)) ;
send(fd, buffer, length, 0) ;
shutdown(fd, 2) ;

Thanks


> Hello
>
> I wonder if linux (2.4 or 2.5) has a programmatic interface available to
> user level code to ask to send the FIN flag piggybacked in a DATA segment.
>
> Say I have an application that want to replace :
>
> send(fd, buffer, 84, 0) ;
> shutdown(fd, 2) ;
>
> 05:00:17.242008 hostA.80 > hostB.2159: P 1:85(84) ack 1 win 5840 (DF)
> 05:00:17.242041 hostA.80 > hostB.2159: F 85:85(0) ack 1 win 5840 (DF)
>
> with :
>
> /* some clever api...  */
>  send_and_shutdown(fd, buffer, 84, FLAGS) ;
>
> 05:00:17.242008 hostA.80 > hostB.2159: PF 1:85(84) ack 1 win 5840 (DF)
>
>
> Thanks
> Eric
>
> -
> : send the line "unsubscribe linux-net" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

-
: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux