Hi all,
I would like to know is it possible to implement a transport
layer protocol such as TCP in java. Although its available in java.net
package, i like to create my own. Also is there any detailed
explanation for source code of java.net package.
Thanks in advance
Christian - 06 Mar 2007 18:07 GMT
Bala Shanmuga Priyan schrieb:
> Hi all,
> I would like to know is it possible to implement a transport
> layer protocol such as TCP in java. Although its available in java.net
> package, i like to create my own.
You can implement your own transport protocol by utilizing UDP .. UDP
gives you basically the Network layer and has nearly no data on
Transportlayer. Forming your own packets directly may not be allowed
based on what OS and what userrights you have, so there is no
implementation in java.
> Also is there any detailed
> explanation for source code of java.net package.
>
> Thanks in advance
Chris Uppal - 06 Mar 2007 18:47 GMT
> I would like to know is it possible to implement a transport
> layer protocol such as TCP in java. Although its available in java.net
> package, i like to create my own. Also is there any detailed
> explanation for source code of java.net package.
If you don't want to layer over UDP (as Christian has already suggested) then
you should be able to do it using a Java wrapper for the pcap library (pcaplib
or WinPcap).
I don't know whether pcap has Java wrappings available yet for sending packets
yet. I not then you'd have to write your own -- but in comparison to
designing, implementing, and testing, a transport-layer protocol, that should
be a doddle ;-)
-- chris
Arne Vajhøj - 12 Mar 2007 04:12 GMT
> I would like to know is it possible to implement a transport
> layer protocol such as TCP in java. Although its available in java.net
> package, i like to create my own. Also is there any detailed
> explanation for source code of java.net package.
Java does not support raw sockets so you would need
to do something in C++ and use JNI.
Maybe look at http://www.savarese.org/software/rocksaw/ !
If it is for a real world problem: forget it and
focus on the higher level problems.
Arne