• Post Reply Bookmark Topic Watch Topic
  • New Topic

Socket options & choice of language

 
Prasanna Wamanacharya
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 111
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Prasanna Wamanacharya
Ranch Hand
Posts: 143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Laudney
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!