[네트워크] UDP 에코 서버
- 최초 등록일
- 2009.04.04
- 최종 저작일
- 2008.12
- 4페이지/ 압축파일
- 가격 1,000원
소개글
컴퓨터 네트워크 자료입니다.
-상대측의 ip주소와 port번호를 메시지와 함께 출력하는 프로그램-
서버로부터 메시지를 받을 때 서버의 ip주소와 port번호를 같이 출력하는 UDP 클라이언트 프로그램입니다.
목차
없음
본문내용
-상대측의 ip주소와 port번호를 메시지와 함께 출력하는 프로그램-
/*서버로부터 메시지를 받을 때 서버의 ip주소와 port번호를 같이 출력하는 UDP 클라이언트 프로그램.*/
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <arpa/inet.h>
#include <sys/types.h>
#include <sys/socket.h>
#define BUFSIZE 30
void error_handling (char *message);
int main (int argc, char **argv)
{
int sock;
char message[BUFSIZE];
int str_len, addr_size;
struct sockaddr_in serv_addr;
struct sockaddr_in from_addr;
if (argc!=3) {
printf("Usage : %s <IP> <port> \n", argv[0]);
exit(1);
}
참고 자료
없음
압축파일 내 파일목록
UDP 에코서버.hwp
uecho_client.c
uecho_server.c