public abstract class Connection extends Object
ServerToClientConnection
is used to manage a TCP socket.Modifier and Type | Field and Description |
---|---|
protected DataOutputStream |
dataOutputStream |
Constructor and Description |
---|
Connection()
default constructor, to be used if the connection is not yet established at instantiation
|
Connection(Socket socket) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
protected abstract void |
connectionResetCallback()
Is called by the InputListener if the connection was reset.
|
String |
getNetworkAddress() |
protected abstract void |
processInputObject(org.eclipse.emf.ecore.EObject inputObject)
Reacts to an incoming Object.
|
protected void |
sendObject(org.eclipse.emf.ecore.EObject object)
Serializes the given object and sends it via the socket.
|
protected void |
setSocket(Socket socket)
Takes a socket and sets the inputStream, outputStream, inputReader and dataOutputStream
affiliated to the connection.
|
protected DataOutputStream dataOutputStream
public Connection()
public Connection(Socket socket) throws IOException
socket
- Socket of the connectionIOException
- if the stream can't be readprotected void setSocket(Socket socket) throws IOException
socket
- the socket to be setIOException
- if the stream can't be readprotected abstract void processInputObject(org.eclipse.emf.ecore.EObject inputObject)
inputObject
- the EMF object that was receivedprotected void sendObject(org.eclipse.emf.ecore.EObject object)
object
- the EMF object to be sentpublic String getNetworkAddress()
protected abstract void connectionResetCallback()
public void close()
Copyright © 2017 smarTen. All rights reserved.