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
|
Rev | Line | |
---|
[97] | 1 | package com.framsticks.communication; |
---|
| 2 | |
---|
| 3 | import com.framsticks.params.annotations.FramsClassAnnotation; |
---|
[105] | 4 | import com.framsticks.util.ExceptionHandler; |
---|
[97] | 5 | import com.framsticks.util.dispatching.RunAt; |
---|
| 6 | |
---|
| 7 | @FramsClassAnnotation |
---|
| 8 | public 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 | |
---|
[105] | 25 | public void send(final String line, ExceptionHandler handler) { |
---|
[97] | 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.