android - Error: Cannot resolve method shutdownInput(),shutdownOutput(),close() -


here code:

public void exit() {     (iterator<socket> iterator = sockets.values().iterator();iterator.hasnext();)     {         socket socket = iterator.next();         try{             socket.shutdowninput();             socket.shutdownoutput();             socket.close();         }catch (exception e)         {          }     } } 

i'm getting error: cannot resolve method shutdowninput(),shutdownoutput(),close().

what doing wrong?

when call iterator.next(), it's going return object, not socket. have cast returned object socket. do:

socket socket = (socket) iterator.next(); 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -