#include #include #include #include #include #include #define SOCKETPATH "/home/flo/uds_socket" void die(const char* msg){perror(msg); exit(1);} int main() { struct sockaddr_un my_sockaddr; my_sockaddr.sun_family=AF_UNIX; strcpy(my_sockaddr.sun_path, SOCKETPATH); int sockaddrlen = strlen(my_sockaddr.sun_path) + sizeof(my_sockaddr.sun_family); int sockfd = socket(AF_UNIX, SOCK_STREAM, 0); if (sockfd == -1) die("socket"); if (connect(sockfd, (struct sockaddr*) &my_sockaddr, sockaddrlen) == -1) die("connect"); write(sockfd,"get\n",4); close(sockfd); return 0; }