립모션을 사용한 로봇손 제어 프로젝트에서 활용하기 위해 소켓 프로그래밍을 구현하게 되었다. 사용자 손 값을 받는 쪽은 윈도우즈 상에 구현되어있고, 로봇 손 하드웨어 제어 부분은 리눅스에 구현되어 있다. 소켓프로그래밍도 기억이 잘 안나고 윈도우즈와 리눅스 사이 통신이 어떻게 되는지 막막했지만, 여러 샘플들이 많이 나와있어서 정리해봤다. 리눅스 서버 #include <stdio.h> #include <sys/types.h> #include <sys/socket.h> #include <netinet/in.h> #include <netdb.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> void error( char *msg ) { perror( msg ); exit(1); } int main(int argc, char *argv[]) { int sockfd, newsockfd, portno = 27015, clilen; ///socket char buffer[512]; struct sockaddr_in serv_addr, cli_addr; int n; int iter=0; int data; int rBuffer[512]; in...