com.badlogic.gdx.net
Interface Socket
- All Superinterfaces:
- Disposable
public interface Socket
- extends Disposable
A client socket that talks to a server socket via some Net.Protocol
. See
Net.newClientSocket(Protocol, String, int, SocketHints)
and Net.newServerSocket(Protocol, int, ServerSocketHints)
.
A socket has an InputStream
used to send data to the other end of the connection, and
an OutputStream
to 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.
- Author:
- mzechner
isConnected
boolean isConnected()
- Returns:
- whether the socket is connected
getInputStream
InputStream getInputStream()
- Returns:
- the
InputStream
used to read data from the other end of the connection.
getOutputStream
OutputStream getOutputStream()
- Returns:
- the
OutputStream
used to write data to the other end of the connection.
Copyright © 2013. All Rights Reserved.