File tree 1 file changed +11
-5
lines changed
1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -169,14 +169,21 @@ function udp_sendto(address, request)
169
169
170
170
sock :settimeout (READ , " b" )
171
171
sock :settimeout (READALL , " t" )
172
- sock :sendto (request , addr , port )
172
+ sock :setpeername (' 192.168.1.100' ,60000 )
173
+ sock :send (request )
173
174
174
175
-- set-ip doesn't return a reply
175
176
if string.byte (request , 2 ) == 0x96 then
176
177
return {}, nil
177
178
end
178
179
179
- return read (sock )
180
+ local packet = sock :receive (1024 )
181
+ if packet and # packet == 64 then
182
+ dump (packet )
183
+ return packet
184
+ end
185
+
186
+ return nil
180
187
end )
181
188
182
189
sock :close ()
@@ -321,12 +328,11 @@ end
321
328
function addrport (address )
322
329
if address and address ~= " " then
323
330
local addr , port = address :match (" ^(.-):(%d*)$" )
324
-
325
331
if addr and port and addr ~= " " and port ~= " " then
326
332
return addr , tonumber (port )
327
- elseif addr and addr ~= " " then
328
- return addr , 60000
329
333
end
334
+
335
+ return address , 60000
330
336
end
331
337
332
338
return " 255.255.255.255" , 60000
You can’t perform that action at this time.
0 commit comments