Package com.badlogic.gdx.net
Interface Socket
-
- All Superinterfaces:
Disposable
- All Known Implementing Classes:
NetJavaSocketImpl
public interface Socket extends Disposable
A client socket that talks to a server socket via someNet.Protocol. SeeNet.newClientSocket(Protocol, String, int, SocketHints)andNet.newServerSocket(Protocol, int, ServerSocketHints). A socket has anInputStreamused to send data to the other end of the connection, and anOutputStreamto receive data from the other end of the connection. A socket needs to be disposed if it is no longer used. Disposing also closes the connection.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.io.InputStreamgetInputStream()java.io.OutputStreamgetOutputStream()java.lang.StringgetRemoteAddress()booleanisConnected()-
Methods inherited from interface com.badlogic.gdx.utils.Disposable
dispose
-
-
-
-
Method Detail
-
isConnected
boolean isConnected()
- Returns:
- whether the socket is connected
-
getInputStream
java.io.InputStream getInputStream()
- Returns:
- the
InputStreamused to read data from the other end of the connection.
-
getOutputStream
java.io.OutputStream getOutputStream()
- Returns:
- the
OutputStreamused to write data to the other end of the connection.
-
getRemoteAddress
java.lang.String getRemoteAddress()
- Returns:
- the RemoteAddress of the Socket as String
-
-