source: java/main/src/main/java/com/framsticks/communication/ClientSideRawConnection.java @ 193

Last change on this file since 193 was 193, checked in by Maciej Komosinski, 10 years ago

Set svn:eol-style native for all textual files

  • Property svn:eol-style set to native
File size: 772 bytes
Line 
1package com.framsticks.communication;
2
3import com.framsticks.params.annotations.FramsClassAnnotation;
4import com.framsticks.util.ExceptionHandler;
5import com.framsticks.util.dispatching.RunAt;
6
7@FramsClassAnnotation
8public class ClientSideRawConnection extends Connection {
9
10        public ClientSideRawConnection() {
11                setDescription("client raw connection");
12        }
13
14        @Override
15        protected void receiverThreadRoutine() {
16                startClientConnection(this);
17
18                processInputBatchesUntilClosed();
19        }
20
21        protected void processNextInputBatch() {
22                getLine();
23        }
24
25        public void send(final String line, ExceptionHandler handler) {
26
27                senderThread.dispatch(new RunAt<ClientSideRawConnection>(handler) {
28                        @Override
29                        protected void runAt() {
30                                putLine(line);
31                                flushOut();
32                        }
33                });
34
35        }
36
37}
Note: See TracBrowser for help on using the repository browser.