Java-Gaming.org    
Featured games (81)
games approved by the League of Dukes
Games in Showcase (498)
Games in Android Showcase (115)
games submitted by our members
Games in WIP (562)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  ICMP in java  (Read 3192 times)
0 Members and 1 Guest are viewing this topic.
Offline starlord

Junior Member





« Posted 2003-06-30 05:02:10 »

how can i make ping(ICMP proto) program using java,
i know i must use jni to do this,but anyone got example c code to do this?

i haven't done much networking stuff in c, so example code or web site url would be helpfull.
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #1 - Posted 2003-07-01 07:47:28 »

AFAIK there is no way to get that far down.

If you want to ping only very special machines, maybe you can have a UDP server there and emulate ICMP with UDP?

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline starlord

Junior Member





« Reply #2 - Posted 2003-07-01 09:25:41 »

i thought so too,but i kept googling around and found ready made jni solution for this.

here's webpage if anyone interested http://www.geocities.com/SiliconValley/Bit/5716/ping/
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #3 - Posted 2003-07-01 10:00:23 »

JNI, of course, ALWAYS works.....

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline lilspikey

Senior Newbie




Computers Stole My Social Skills


« Reply #4 - Posted 2003-07-03 17:12:21 »

You could also use Runtime.exec() to start a ping process and parse the output (whcih would be different depending on whether you were on windows or linux/unix).
See:

 http://www.btinternet.com/~duncan.jauncey/old/sonar.html

Depends whether you just wanted to check whether servers were up, or do something else with icmp.

Offline starlord

Junior Member





« Reply #5 - Posted 2003-07-04 03:51:25 »

i only wanted to know if the server is up,
so the ping program from website i posted earlier had all the needed values.

i thought also about using Runtime to execute ping but this seemed good solutions as i don't need to parse ping output(not difficult but still) and i have ready made component to do this.

but the ping jni only run's on win platform so if i ever needed it to be running on linux,i guess i need to use runtime and parse output.i'm not that great on c socket's.

ps.anyone know multiplatform socket api for c?

win and linux socket programming on c are quite diffrent.

Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #6 - Posted 2003-07-04 07:42:34 »

?? Don't they both have a POSIX style interface?

You are not forced to use that WSA_* stuff.

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline starlord

Junior Member





« Reply #7 - Posted 2003-07-04 08:16:58 »

don't know, i have always used WSA_*

and never found POSIX style example for win
Offline Herkules

Senior Member




Friendly fire isn't friendly!


« Reply #8 - Posted 2003-07-04 12:10:17 »

well, try the POSIX examples  Grin

HARDCODE    --     DRTS/FlyingGuns/JPilot/JXInput  --    skype me: joerg.plewe
Offline darcone

Junior Member




Size matters


« Reply #9 - Posted 2003-08-13 10:50:09 »

Why wont the java dev people base all the socket stuff on some RAW class, so that we people can write our own packets? Bad, bad java devs!
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

radar3301 (11 views)
2014-09-21 23:33:17

BurntPizza (28 views)
2014-09-21 02:42:18

BurntPizza (18 views)
2014-09-21 01:30:30

moogie (20 views)
2014-09-21 00:26:15

UprightPath (27 views)
2014-09-20 20:14:06

BurntPizza (29 views)
2014-09-19 03:14:18

Dwinin (47 views)
2014-09-12 09:08:26

Norakomi (74 views)
2014-09-10 13:57:51

TehJavaDev (102 views)
2014-09-10 06:39:09

Tekkerue (50 views)
2014-09-09 02:24:56
List of Learning Resources
by Longor1996
2014-08-16 10:40:00

List of Learning Resources
by SilverTiger
2014-08-05 19:33:27

Resources for WIP games
by CogWheelz
2014-08-01 16:20:17

Resources for WIP games
by CogWheelz
2014-08-01 16:19:50

List of Learning Resources
by SilverTiger
2014-07-31 16:29:50

List of Learning Resources
by SilverTiger
2014-07-31 16:26:06

List of Learning Resources
by SilverTiger
2014-07-31 11:54:12

HotSpot Options
by dleskov
2014-07-08 01:59:08
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!