mirror of
https://github.com/dragoonDorise/EmuDeck.git
synced 2024-05-20 13:17:55 -04:00
netplay speed up
This commit is contained in:
parent
e5c9b481ec
commit
4da3653fb6
|
@ -7,6 +7,7 @@
|
|||
# netplayCMD - local inet
|
||||
|
||||
#Searchs for a device with the netplay port open
|
||||
|
||||
netplaySetIP(){
|
||||
localIP=$(ip addr show $(ip route | awk '/default/ { print $5 }') | grep "inet" | head -n 1 | awk '/inet/ {print $2}' | cut -d'/' -f1)
|
||||
segment=$(echo $localIP | awk -F '.' '{print $1"."$2"."$3}')
|
||||
|
@ -15,9 +16,10 @@ netplaySetIP(){
|
|||
for i in {2..255}; do
|
||||
{
|
||||
ip="$subnet$i"
|
||||
if (echo > /dev/tcp/$ip/$port) >/dev/null 2>&1; then
|
||||
echo $ip
|
||||
if timeout 0.05 bash -c "echo > /dev/tcp/$ip/$port"; then
|
||||
setSetting netplayCMD "'-C $ip'"
|
||||
exit
|
||||
break
|
||||
fi
|
||||
} &
|
||||
done
|
||||
|
|
Loading…
Reference in a new issue