@Override public MulticastSocket createMulticastSocket(String name) throws IOException { String socketBindingName = this.getSocketBindingName(name); return this.manager.createMulticastSocket(socketBindingName); }
@Override public MulticastSocket createMulticastSocket(String name, SocketAddress address) throws IOException { if (address == null) return this.createMulticastSocket(name); String socketBindingName = this.getSocketBindingName(name); return this.manager.createMulticastSocket(socketBindingName, address); }
private void createMulticastSocket(String serviceName, String bindingName) throws IOException { MulticastSocket socket1 = mock(MulticastSocket.class); MulticastSocket socket2 = mock(MulticastSocket.class); MulticastSocket socket3 = mock(MulticastSocket.class); SocketAddress address = new InetSocketAddress(InetAddress.getLocalHost(), 1); when(this.manager.createMulticastSocket(bindingName)).thenReturn(socket1); when(this.manager.createMulticastSocket(bindingName, new InetSocketAddress(1))).thenReturn(socket2); when(this.manager.createMulticastSocket(bindingName, address)).thenReturn(socket3); MulticastSocket result1 = this.subject.createMulticastSocket(serviceName); MulticastSocket result2 = this.subject.createMulticastSocket(serviceName, 1); MulticastSocket result3 = this.subject.createMulticastSocket(serviceName, address); assertSame(socket1, result1); assertSame(socket2, result2); assertSame(socket3, result3); }
/** * Create a multicast socket. * * @return the multicast socket * @throws IOException */ // TODO JBAS-8470 automatically joingGroup public MulticastSocket createMulticastSocket() throws IOException { return socketBindings.createMulticastSocket(name, getSocketAddress()); }
/** * Create a multicast socket. * * @return the multicast socket * @throws IOException */ public MulticastSocket createMulticastSocket() throws IOException { return socketBindings.createMulticastSocket(name, getMulticastSocketAddress()); }
/** * Create a multicast socket. * * @return the multicast socket * @throws IOException */ // TODO JBAS-8470 automatically joingGroup public MulticastSocket createMulticastSocket() throws IOException { return socketBindings.createMulticastSocket(name, getSocketAddress()); }
@Override public MulticastSocket createMulticastSocket(String name) throws IOException { String socketBindingName = this.getSocketBindingName(name); return this.manager.createMulticastSocket(socketBindingName); }
@Override public MulticastSocket createMulticastSocket(String name, SocketAddress address) throws IOException { if (address == null) return this.createMulticastSocket(name); String socketBindingName = this.getSocketBindingName(name); return this.manager.createMulticastSocket(socketBindingName, address); }