ExistRuby 0.1.3 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ExistRuby/MulticastHandler.rb +8 -3
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d82c5e28d39173839cd89797b76a71dd5c6dd4f1
|
4
|
+
data.tar.gz: c232c351fbe43c2f49d5c6e45f67415afa869a04
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4a44e6cfdf3381efe7889cf52485a47245a9c6fdbef37d7c0d223c0e0b814f36d1032261ac0f247006a4f9a6749ee2e134c0d76e2a0b4533490f7daa5fc40469
|
7
|
+
data.tar.gz: a3a5b0aca1f2009510f70257ef32d7c6ec4f7099d9ec23e707c7a8869029683b6062b78f204f1095527f2942aaa297f3848a97c2271fd86e679f47b3a19ca7b1
|
@@ -5,15 +5,20 @@ require 'ipaddr'
|
|
5
5
|
|
6
6
|
class MulticastHandler < EventMachine::Connection
|
7
7
|
def castData(packageString)
|
8
|
-
|
8
|
+
multicastHost = '239.173.40.5' #组播组主机地址。
|
9
|
+
multicastPort = 11500 #组播组端口。
|
10
|
+
|
11
|
+
# print("castData\n") #Debug.
|
12
|
+
# send_data(packageString)
|
13
|
+
send_datagram(packageString, multicastHost, multicastPort) #发送组播数据包。
|
9
14
|
end
|
10
15
|
|
11
16
|
def receive_data(data)
|
12
|
-
|
17
|
+
# puts data
|
13
18
|
end
|
14
19
|
|
15
20
|
def post_init
|
16
|
-
|
21
|
+
# print("post_init\n") #Debug.
|
17
22
|
port, host = Socket::unpack_sockaddr_in( get_sockname() )
|
18
23
|
ip = IPAddr.new( host ).hton + IPAddr.new("0.0.0.0").hton
|
19
24
|
set_sock_opt( Socket::IPPROTO_IP, Socket::IP_ADD_MEMBERSHIP, ip )
|