Files
mars-libowfat/socket/socket_connected.c
2025-01-20 18:07:12 +00:00

16 lines
284 B
C

#include <sys/types.h>
#ifndef __MINGW32__
#include <sys/socket.h>
#include <netinet/in.h>
#endif
#include <libowfat/socket.h>
#include "havesl.h"
int socket_connected(int s) {
struct sockaddr si;
socklen_t sl=sizeof si;
if (getpeername(s,&si,&sl))
return 0;
return 1;
}