네트워크 숫자야구게임 - UDP, TCP 사용
- 최초 등록일
- 2004.05.04
- 최종 저작일
- 2004.05
- 3페이지/ 압축파일
- 가격 1,000원
소개글
연결을 하기위해 UDP소켓을 이용하고,
게임을 위해 TCP소켓을 이용합니다.
다중 접속 지원합니다.
리눅스 base입니다.
컴파일 실행환경
총 3개 파일
server.c
client.c
common.h
본문내용
server.c
#include <stdio.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <sys/types.h>
#include <string.h>
#include <errno.h>
#define DISG_PORT 9005 // UDP port - I couldn't test 9000 because most students use this port.
#define TCP_PORT "30661" // TCP port
#define BUF_LEN 3
#define MAX_LINE 512
typedef struct sockaddr SA;
// function define
void baseball_client(int, char *);
void bbgame(int);
void bbgame_server(int sock_fd);
void user_check(int sock_fd, SA *pcli_addr, socklen_t cli_len);
압축파일 내 파일목록
common.h
server.c
client.c
참고 자료
없음