private NetProtocol checkProtocol ( String protocol ) { // First check out whether the protcol is something we are aware of. NetProtocol proto = NetProtocol . getProtocol ( protocol ) ; if ( proto == null || ! proto . valid ) { errno . set ( ZError . EPROTONOSUPPORT ) ; return proto ; } // Check whether socket type and transport protocol match. // Specifically, multicast protocols can't be combined with // bi-directional messaging patterns (socket types). if ( ! proto . compatible ( options . type ) ) { errno . set ( ZError . ENOCOMPATPROTO ) ; return null ; } // Protocol is available. return proto ; }
bind is available and compatible with the socket type .