블로그 이미지
footprintz
제대로 달려, 전력 질주 할 수 있는 시간은 의외로 짧아...

calendar

1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31

Notice

'개발 이야기/Network'에 해당되는 글 2

  1. 2013.12.24 [protocol] max http header length
  2. 2009.01.15 INADDR_ANY1
2013. 12. 24. 19:41 개발 이야기/Network

HTTP does not define any limit. However most web servers do limit size of headers they accept. 


For example in Apache default limit is 8KB, in IIS it's 16K


Server will return 413 Entity Too Large error if headers size exceeds that limit.


cf)

Apache 2.0, 2.2: 8K

nginx: 4K - 8K

IIS: varies by version, 8K - 16K

Tomcat: varies by version, 8K - 48K (?!)


 - 원문 : http://stackoverflow.com/questions/686217/maximum-on-http-header-values

posted by footprintz
2009. 1. 15. 09:38 개발 이야기/Network

#include<stdio.h>
#include<stdlib.h>
#include<arpa/inet.h>
#include<sys/types.h>
#include<sys/socket.h>
#include<string.h>
int main(int argc, char** argv)
{
//     char *serv_port = "8080";
        char *str;
        struct sockaddr_in addr_ip_address;
        socket(PF_INET,SOCK_STREAM,0);
        memset(&addr_ip_address, 0, sizeof(addr_ip_address));
        addr_ip_address.sin_family = AF_INET;

        addr_ip_address.sin_addr.s_addr = htonl(INADDR_ANY);
        printf("INADDR_ANY : %s\n",INADDR_ANY);
        str = inet_ntoa(addr_ip_address.sin_addr);

        printf("%s\n", str);
        return 0;
}

========================================================================================[judgementday@localhost network_programming]$ ./ip_address
INADDR_ANY : (null)
0.0.0.0
========================================================================================

INADDR_ANY 은 localhost인데 자신의 IP가 아닌 ox0000~으로 되어있다. INADDR_ANY로 주소를 잡아주면 커널(OS)이 그 주소를 잡아주는게 아니라 0.0.0.0으로 대기중에 있다가 connect(클라이언트)에서 특정 서버로 접속하면 소켓이 바인드 된다.

한동안 손 놓고 있다가 다시 볼려니 뭔지 잘 모르겠다.
이런, 바보!! ㅠ

[출처 : http://blog.naver.com/kernoarsid02]

posted by footprintz
prev 1 next