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