Im wesentlichen besprechen wir drei Gruppen von Routinen:
Server:
srv = new ServerSocket(port)
,
s = srv.accept()
,
new ObjectInputStream(s)
Client:
s = new Socket(host,port)
,
new ObjectOutputStream(s)
ch.out.writeObject(ei)
vi=ch.in.readObject()
Server:
srv = new ServerSocket(port)
,
s = srv.accept()
,
ch.in = new ObjectInputStream(s.getInputStream())
Client:
s = new Socket(host,port)
,
ch.out = new ObjectOutputStream(s.getOutputStream())
synchronized(ch.out) {
ch.out.writeObject(e1);
...
ch.out.writeObject(en);}
}
synchronized(ch.in) {
v1=ch.in.readObject();
...
vn=ch.in.readObject();
}
Shared Mem: Asynchronous Channels, ex9.java
Shared Mem: Synchronous Channels, ex9s.java
[Previous] [Next] [Contents]