sappho-socket 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/sappho-socket/safe_server.rb +3 -2
- data/lib/sappho-socket/version.rb +1 -1
- metadata +3 -3
@@ -12,10 +12,11 @@ module Sappho
|
|
12
12
|
|
13
13
|
class SafeServer
|
14
14
|
|
15
|
-
def initialize name, port, maxClients = 10, detailedLogging = false
|
15
|
+
def initialize name, port, maxClients = 10, timeout = 10, detailedLogging = false
|
16
16
|
@name = name
|
17
17
|
@port = port
|
18
18
|
@maxClients = maxClients
|
19
|
+
@timeout = timeout
|
19
20
|
@detailedLogging = detailedLogging
|
20
21
|
@clients = {}
|
21
22
|
@mutex = Mutex.new
|
@@ -41,7 +42,7 @@ module Sappho
|
|
41
42
|
log ip, 'connected' if @detailedLogging
|
42
43
|
end
|
43
44
|
Thread.new client, ip do | client, ip |
|
44
|
-
socket = SafeSocket.new
|
45
|
+
socket = SafeSocket.new @timeout
|
45
46
|
socket.attach client
|
46
47
|
begin
|
47
48
|
yield socket, ip, @name, @port
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sappho-socket
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 19
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 4
|
10
|
+
version: 0.1.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andrew Heald
|