[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK3+h2yFeww84QStvugyaYGfWsL2cw3TnG3CoeLk-q2pQ70_+w@mail.gmail.com>
Date: Fri, 23 Mar 2012 08:38:08 -0700
From: Vincent Li <vincent.mc.li@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
Cc: netdev@...r.kernel.org
Subject: Re: Piggyback the final ACK of the three way TCP connection
establishment with the data
On Thu, Mar 22, 2012 at 4:17 PM, Eric Dumazet <eric.dumazet@...il.com> wrote:
> On Thu, 2012-03-22 at 16:13 -0700, Eric Dumazet wrote:
>
>> A third possibility (reading the code) if you use non blocking IO, is to
>> send() a message right after connect()
>>
>>
>
> Or use the auto connect on sendto() more probably...
>
> That combines the connect() and send()
>
thanks,
I got the TCP_QUICKACK working, but not the non blocking IO,
basically, what I did is
if((sock = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0){
perror("Can't create TCP socket");
return 0;
}
val = Fcntl(sock, F_GETFL, 0);
Fcntl(sock, F_SETFL, val | O_NONBLOCK);
ip = get_ip(host);
fprintf(stderr, "IP is %s\n", ip);
remote = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in *));
remote->sin_family = AF_INET;
tmpres = inet_pton(AF_INET, ip, (void *)(&(remote->sin_addr.s_addr)));
if( tmpres < 0)
{
perror("Can't set remote->sin_addr.s_addr");
return 0;
}else if(tmpres == 0)
{
fprintf(stderr, "%s is not a valid IP address\n", ip);
return 0;
}
remote->sin_port = htons(PORT);
char *query = "GET / HTTP/1.0\r\nHost: 127.0.0.1\r\n\r\n";
tmpres = sendto(sock, query, strlen(query), 0, (struct sockaddr
*)remote, sizeof(struct sockaddr));
maybe I mis-interpret you.
Vincent
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists