File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Sockets and Internet Protocols and the fly likes Socket options & choice of language Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Sockets and Internet Protocols
Reply Bookmark "Socket options & choice of language" Watch "Socket options & choice of language" New topic
Author

Socket options & choice of language

Prasanna Wamanacharya
Ranch Hand

Joined: Apr 24, 2001
Posts: 143
Hello Javaranchers,
I would like to know whether the java.net API supports all the socket options of the "socket.h" C library.
Also, how should one make a choice of language while developing networking apps.
Some criterion could be -
Faster vs Platform-Independence
Low level vs High level
Thanks in advance
Prasanna.
Laudney Ren
Ranch Hand

Joined: Jan 06, 2002
Posts: 111
There are 4 socket options for java1.1, 6 options for java1.2 and 7 options for java1.3:
TCP_NODELAY
SO_BINDADDR
SO_TIMEOUT
SO_LINGER
SO_SNDBUF //java1.2 and later
SO_RCVBUF //java1.2 and later
SO_KEEPALIVE //java1.3 and later
Acccording to POSIX, there are 22 main socket options plus 26 additional ones.
22 main options here:
//level: SOL_SOCKET
//can be found in linux at sys/socket.h
SO_BROADCAST
SO_DEBUG
SO_DONTROUTE
SO_ERROR
SO_KEEPALIVE
SO_LINGER
SO_OOBINLINE
SO_RCVBUF
SO_SNDBUF
SO_RCVLOWAT
SO_SNDLOWAT
SO_RCVTIMEO
SO_SNDTIMEO
SO_REUSEADDR
SO_REUSEPORT
SO_TYPE
SO_USELOOPBACK
//level IPPROTO_TCP
//under linux: linux/tcp.h
TCP_KEEPALIVE
TCP_MAXRT
TCP_MAXSEG
TCP_NODELAY
TCP_STDURG
so, choose according to your requirement.


" Veni, vidi, vici "<br />" I came, I saw, I conquered "
Prasanna Wamanacharya
Ranch Hand

Joined: Apr 24, 2001
Posts: 143
Thanks Laudney
 
 
subject: Socket options & choice of language
 
Threads others viewed
GOF vs Head First Design Patterns
TCP vs HTTP Vs HTTPs
PHP vs JSP
socket vs RMI
RMI Vs Sockets
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com