![]() |
| ||
| IP blocking or MAC address blocking Is there any class in java or a package that one can use to manage IP configuration. I mean i was planing to develop a cafe timing application that allows people to bring in there computer system and it will not allow the client system to browse when their time expires. And I want it to run on the server so there wont be need to have the application on the client system |
| ||
| Re: IP blocking or MAC address blocking haven't heard of a standard api that does that, but there's no-one to hold you back and write it. let your client retreive the ip-address, send it to the server. to let the client disconnect when "time expires", you could : a. let the client run a thread which continously checks with the server wether or not it has expired, or, you could go the way I would b. let the server send a disconnect-command to the client, based upon the time of login. |
| ||
| Re: IP blocking or MAC address blocking You can have look on java.net package, but there is not too much to it |
| ||
| Re: IP blocking or MAC address blocking According to me the MAC-Address comes into play at the Data Link Layer, whereas Java can go down only till the Transport Layer. One of the reasons why I had read "ping" cannot be written in Java. |
| ||
| Re: IP blocking or MAC address blocking Ping cannot be accessed directly you can use Runtime to execute console ping command and read it in, but this is awkward solution |
| ||
| Re: IP blocking or MAC address blocking Quote:
|
| ||
| Re: IP blocking or MAC address blocking Saying that 'XXX is not possible in Java' is pretty misleading IMO. Is I/O and Networking possible in Java? You might say yes, there are packages like java.io.*and java.net.*for it. But is it really possible in *java*? Both I/O and Networking libraries which are part of the standard libraries at their core make JNI calls and are platform specific since the way I/O is performed is OS/platform specific. So as long as you have the proper JNI code in place along with dynamic libraries for your target platforms, almost anything is possible in Java. The same argument applies to 'Java only works at Application/Transport layer'. But to answer the question, yes, a ping utiilty can't be written using the standard Java libraries, since AFAIK, Java doesn't allow creation of raw sockets which are needed to send ICMP packets. Quote:
|
| ||
| Re: IP blocking or MAC address blocking Quote:
the Standard Java Library. But being a Java programmer I did love the statement :- Quote:
Also when I read some material on Raw Sockets, I noticed that the packets arriving on them bypass the normal processing on the TCP/IP Protocol stack (by the kernel), So **I guess** we can actually drop down not only to the Network layer, but also access the Data Link Layer headers here. Thanks again, discovered another new thing today and Sorry for hijacking your thread awo. |
| ||
| Re: IP blocking or MAC address blocking The view presented by the Java programming language for anything networking related is too high level/abstract [which is a good thing from productivity POV]. Writing networking code in C is probably the best way of hacking around with the core networking protocols and to see how the things really work; something which has been on my TODO list for quite some time. :-) |
| All times are GMT -4. The time now is 7:23 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC