[zeromq-dev] Requesting suggestions for getsockopt() in Java

gonzalo diethelm gdiethelm at dcv.cl
Mon Aug 9 16:37:20 CEST 2010


> > As always, just copy Sun's original implementation, implement
getters
> > and setters for every socket option:
> 
> +1

Ok, but I seem to remember there was a point made about not adding
separate interfaces for each socket option; this way, when new options
are added, old code can be made aware of them without changes (or
something to that effect). Perhaps this only applied to C code.

So, if we go the full Java way, we would end up with the following
methods:

  void setSocketHWM(int hwm);
  void setSocketSwap(int swap);
  void setSocketAffinity(int affinity);
  void setSocketIdentity(byte[] identity);
  void setSocketSubscribe(byte[] subscribe);
  void setSocketUnsubscribe(byte[] unsubscribe);
  void setSocketRate(int rate);
  void setSocketRecoveryInterval(int recovery_interval);
  void setSocketMulticastLoop(boolean multicast_loop);
  void setSocketSendBufferSize(int sndbuf);
  void setSocketReceiveBufferSize(int rcvbuf);
  void setSocketReceiveMore(boolean rcvmore);

  int getSocketHWM();
  int getSocketSwap();
  int getSocketAffinity();
  byte[] getSocketIdentity();
  byte[] getSocketSubscribe();
  byte[] getSocketUnsubscribe();
  int getSocketRate();
  int getSocketRecoveryInterval();
  boolean getSocketMulticastLoop();
  int getSocketSendBufferSize();
  int getSocketReceiveBufferSize();
  boolean getSocketReceiveMore();

Thoughts?

-- 
Gonzalo Diethelm




More information about the zeromq-dev mailing list