net-server 1.0.0 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -1
- data/README.md +8 -0
- data/lib/net/server.rb +1 -1
- data/lib/net/version.rb +2 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d0d6f7b4c02857c1000e74c563c9c03b39508231
|
4
|
+
data.tar.gz: 74993ccefec2ecaae028d429da06f7324eb295a1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ea63dbc592a3618103e7e4cb834c4931b03b300727c25da48741b1ca1e88ed7a6a8db1ee24a822a512a8b5dcb3815cf67e7a2d8dfd793a3a6777aa2beb20b28e
|
7
|
+
data.tar.gz: 8850708991d7fb0dd390f1357aee4228ed4d3e5c5fc8007c8f6e680dd6eeae1d666f565d8cd87cdd57e90717f8f7e2cab300abf0df2f4e3dbd0f3626dd50005d
|
data/CHANGELOG.md
CHANGED
@@ -1,2 +1,5 @@
|
|
1
|
-
# v1.0
|
1
|
+
# v1.1.0
|
2
|
+
Added the server's options to the instantiation of the Receiver class. This allows all options to be passed into the system in one place, namely, the server start line (see the last line in one of the example programs).
|
3
|
+
|
4
|
+
# v1.0.0
|
2
5
|
This is the initial load of the gem. This gem was taken from an earlier work of mine, so as far as I know, it is bug-free (but never count on code being bug free). If you find a problem, report it to me at mjwelchphd@gmail.com, or FORK the library, fix the bug, then add a Pull Request.
|
data/README.md
CHANGED
@@ -54,8 +54,14 @@ require 'net/server'
|
|
54
54
|
|
55
55
|
class Receiver
|
56
56
|
|
57
|
+
def initialize(connection, options)
|
58
|
+
@connection = connection
|
59
|
+
@options = options
|
60
|
+
end
|
61
|
+
|
57
62
|
def receive(local_port, local_hostname, remote_port, remote_hostname, remote_ip)
|
58
63
|
<send and receive data>
|
64
|
+
# when this method exits, the process is cleaned up and terminated by Net::Server
|
59
65
|
end
|
60
66
|
|
61
67
|
end
|
@@ -80,6 +86,8 @@ There are two test applications included in the gem in the examples folder. Test
|
|
80
86
|
:pid_file | "pid" | The PID of the server will be stored in this file.
|
81
87
|
:daemon | false | If this option is true, the server will be started as a daemon.
|
82
88
|
|
89
|
+
You can pass Receiver options thru here also because these options are passed to the Receiver during the instantiation of the Receiver object. You can add options that you'll use in your own programming as well. Net::Server only looks for it's own options, so the presence of other options does no harm.
|
90
|
+
|
83
91
|
## Logging
|
84
92
|
|
85
93
|
The log file must be created by the 'logger' gem, and must be named LOG.
|
data/lib/net/server.rb
CHANGED
@@ -54,7 +54,7 @@ private
|
|
54
54
|
|
55
55
|
# a new object is created here to provide separation between server and receiver
|
56
56
|
# this call receives the email and does basic validation
|
57
|
-
Receiver::new(connection).receive(local_port, Socket::gethostname, remote_port, remote_hostname, remote_ip)
|
57
|
+
Receiver::new(connection, @options).receive(local_port, Socket::gethostname, remote_port, remote_hostname, remote_ip)
|
58
58
|
rescue ServerQuit
|
59
59
|
# nothing to do here
|
60
60
|
end
|
data/lib/net/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: net-server
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael J. Welch, Ph.D.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-09-
|
11
|
+
date: 2015-09-14 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Ruby Net server.
|
14
14
|
email:
|