Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

just a bit of code I made to let you see the results of pinging a server..

<code>

// GetLatency ( fm_ip ; fm_port ; verbose )

// 15_08_03 JohnRenfrew

// v1.0

// fm_ip is IP address or web address

// fm_port is port to ping - defaults to 80

// verbose - if empty returns just average, else anything returns results of 5 loops

 

import java.net.Socket

import java.net.InetAddress

import java.net.SocketAddress

import java.net.InetSocketAddress

import java.net.SocketTimeoutException

 

port = !fm_port ? 80i : fm_port.toInteger()

times = 5

result = ''

try { 

    hostaddr = InetAddress.getByName(fm_ip).getHostAddress() 

} catch (UnknownHostException e) { 

    result = 'Invalid Host entered.' 

}

if ( result != '' ){

    return result

}

result += 'Pinging '+fm_ip+' (' + hostaddr + ') ' + times + ' times on port ' + port + '...'

total = 0i

totalping = 0l

Socket s = null

for ( i in 1..times) {

    start = System.currentTimeMillis()

    try {

        sockaddr = new InetSocketAddress(hostaddr, port)

        s = new Socket()

        s.connect(sockaddr, 1000)

        } catch(SocketTimeoutException e) {

            result += '\nSocket Request[' + i + ']: Connection timed out.'

            times = times - 1

            continue

        } catch( e) {

        }

        end = System.currentTimeMillis()

        totalping += (end-start)

        totaltime = (end-start)

        avg = (totalping/i)

        result += '\nSocket Request['+ i +']: Time(In MS): '  +totaltime + ' Average: '+avg

    }

result += '\n'

averagePing = totalping/ Math.max(times, 1)

result += '\nFinal Result: Average request - ' + averagePing + '\n'

if ( verbose ){

    return result

} else {

    return avgPing

}

</code>

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.