bind() error

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

bind() error

861件の閲覧回数
netra
Contributor IV

I am creating socket within a while(1) loop & shutting down socket using shutdown().

Again when it reaches in the beginning of the loop , it is throwing error during bind().

please reply

ラベル(1)
1 返信

752件の閲覧回数
mohwaqas12
Contributor III

Hello netra,

Well normally , we do not use bind in a while loop . I believe you should setup a socket, outside a while loop and call accept in a while loop , accept would return u a new socket handle.

If you only want a single connection and want to use bind inside while , then you should try to check what error does bind returns and try to read what it means in rtcs.h file . You would probably get some clue