만약에 컴터에 10mbps, 100mbps,1gbps짜리 이더넷 카드 3장이 꽂혀있는데
socket(AF_INET,SOCK_DGR..생략)
이런식으로socket디스크립터를 얻게 되면 이디스크립터는 어느 이더넷카드의 디스크립터인가요? socket함수로 특정 이더넷카드를 통해 socket통신하고싶을때는 어떤식으로 해야할까요..
bind함수를 호출 하실때 INADDR_ANY 대신 랜카드에 할당 된 아이피를 직접 넣어주시면 됩니다.
inet_addr 같은 함수를 이용해서 문자열을 변환해서 넣으시면 됩니다. bind는 listen, connect 하기전에
모두 적용이 가능합니다.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
bind함수를 호출
bind함수를 호출 하실때 INADDR_ANY 대신 랜카드에 할당 된 아이피를 직접 넣어주시면 됩니다.
inet_addr 같은 함수를 이용해서 문자열을 변환해서 넣으시면 됩니다. bind는 listen, connect 하기전에
모두 적용이 가능합니다.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
-------------------------------------------------------------------------------
It's better to appear stupid and ask question than to be silent and remain stupid.
댓글 달기