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
Post a Comment