C++Builder Programming Forum
C++Builder  |  Delphi  |  FireMonkey  |  C/C++  |  Free Pascal  |  Firebird
볼랜드포럼 BorlandForum
 경고! 게시물 작성자의 사전 허락없는 메일주소 추출행위 절대 금지
C++빌더 포럼
Q & A
FAQ
팁&트릭
강좌/문서
자료실
컴포넌트/라이브러리
메신저 프로젝트
볼랜드포럼 홈
헤드라인 뉴스
IT 뉴스
공지사항
자유게시판
해피 브레이크
공동 프로젝트
구인/구직
회원 장터
건의사항
운영진 게시판
회원 메뉴
북마크
볼랜드포럼 광고 모집

C++빌더 Q&A
C++Builder Programming Q&A
[62075] Re:바인드 설정 실패
Nibble [gameover] 1515 읽음    2010-08-05 01:11
WSANOTINITIALISED    A successful WSAStartup must occur before using this function.
WSAENETDOWN    The network subsystem has failed.
WSAEADDRINUSE     The specified address is already in use. (See the SO_REUSEADDR socket option under setsockopt.)
WSAEFAULT    The name or the namelen argument is not a valid part of the user address space, the namelen argument is too small, the name argument contains incorrect address format for the associated address family, or the first two bytes of the memory block specified by name does not match the address family associated with the socket descriptor s.
WSAEINPROGRESS    A blocking Windows Sockets 1.1 call is in progress, or the service provider is still processing a callback function.
WSAEINVAL    The socket is already bound to an address.
WSAENOBUFS    Not enough buffers available, too many connections.
WSAENOTSOCK    The descriptor is not a socket.

bind 의 에러 코드 리스트 입니다.
bind 함수를 리턴값을 직접 화면에 뿌려 보시면 도움이 되실지도요.

이영섭 님이 쓰신 글 :
: 윈도우 서버 프로그램을 하나 만들어보려고 볼랜드 2010으로 연습하는데, 맨 처음에 소켓 설정하는건 되는데, 바인드하는 부분이 안되네요. 책에서는 아무런 말도 없고, 인터넷을 뒤져봐도 당연히 되는것처럼 써있어서 하루종일 헤메다가 여기 질문 올려요.
:
: 소스 첨부합니다.
:
:      SOCKET ssock, csock;
:     SOCKADDR_IN server_addr;
:
:     if((ssock =socket(AF_INET, SOCK_STREAM, IPPROTO_TCP)) < 0)
:     {
:        ShowMessage("생성 실패");
:        return false;
:     }

:     memset(&server_addr, 0, sizeof(server_addr));
:     server_addr.sin_family = AF_INET;
:     server_addr.sin_addr.s_addr =   htonl(INADDR_ANY);
:     server_addr.sin_port = htons(3317);
:
:     if(bind(ssock, (struct sockaddr *)&server_addr, sizeof(server_addr)) < 0)
:     {    
:        ShowMessage("바인드 실패");
:        return false;
:
:     }
:
: 책에서 써진대로 해봤는데 바인드가 안되더라구요. 네트워크 설정이나 기타 다른 설정이 필요한가요?
: OS는 윈도우7쓰고있습니다.

+ -

관련 글 리스트
62070 바인드 설정 실패 이영섭 1061 2010/08/04
62075     Re:바인드 설정 실패 Nibble 1515 2010/08/05
Google
Copyright © 1999-2015, borlandforum.com. All right reserved.