Mirror of :pserver:cvs@cvs.fefe.de:/cvs libowfat https://www.fefe.de/libowfat/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
497 B

#include "socket.h"
#include <sys/types.h>
#include <unistd.h>
#include <sys/socket.h>
#include <errno.h>
ssize_t socket_fastopen_connect4(int s,const char* ip,uint16 port,const char* buf,size_t len) {
int r;
int r=socket_send4_flag(s,buf,len,ip,port,MSG_FASTOPEN);
if (r==-1 && errno==ENOTCONN) {
/* apparently the kernel does not support TCP fast open */
if (r==0) return write(s,buf,len);
return r;