|
Revision 326, 433 bytes
(checked in by gethema..@gmail.com, 1 month ago)
|
check in new backgroundrb code
|
| Line | |
|---|
| 1 |
require "socket" |
|---|
| 2 |
|
|---|
| 3 |
class TCPSocket |
|---|
| 4 |
attr_accessor :connection_status |
|---|
| 5 |
attr_accessor :internal_buffer |
|---|
| 6 |
def initialize ip,port |
|---|
| 7 |
@internal_buffer = [] |
|---|
| 8 |
end |
|---|
| 9 |
|
|---|
| 10 |
def trigger |
|---|
| 11 |
|
|---|
| 12 |
end |
|---|
| 13 |
|
|---|
| 14 |
def self.open server_ip |
|---|
| 15 |
|
|---|
| 16 |
end |
|---|
| 17 |
|
|---|
| 18 |
def setsockopt *args; end |
|---|
| 19 |
|
|---|
| 20 |
def >> crap |
|---|
| 21 |
@internal_buffer << Marshal.dump(crap) |
|---|
| 22 |
end |
|---|
| 23 |
|
|---|
| 24 |
def read |
|---|
| 25 |
@internal_buffer.shift |
|---|
| 26 |
end |
|---|
| 27 |
|
|---|
| 28 |
def write crap; end |
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
def close |
|---|
| 32 |
@connection_status = :closed |
|---|
| 33 |
end |
|---|
| 34 |
end |
|---|