Package etch.util

Examples of etch.util.URL


   * @param uri
   * @param resources
   */
  public TcpConnection( Socket socket, String uri, Resources resources )
  {
    this( socket, new URL( uri ), resources );
  }
View Full Code Here


   * @param uri
   * @param resources
   */
  public Packetizer( TransportData transport, String uri, Resources resources )
  {
    this( transport, new URL( uri ), resources );
  }
View Full Code Here

   * @throws Exception
   */
  public UdpConnection( String uri, Resources resources )
    throws Exception
  {
    URL u = new URL( uri );
   
    listen = u.getBooleanTerm( "listen", false );
   
    host = translateHost( u.getHost() );
    if (!listen && host == null)
      throw new IllegalArgumentException( "host == null" );
   
    port = u.getPort();
    if (port == null)
      throw new IllegalArgumentException( "port == null" );
   
    if (port <= 0 || port > 65535)
      throw new IllegalArgumentException( "port <= 0 || port > 65535" );
   
    setDefaultTrafficClass( u.getIntegerTerm( TRAFFIC_CLASS, 0 ) );
   
    // there are three ways to do this:
    // 1. bound socket, unconnected (listening to anyone on well-known host/port
    // 2. bound socket, connected (listening to someone on well-known host/port)
    // 3. unbound socket, connected (listening to someone on assigned host/port)
View Full Code Here

   * @param uri
   * @param resources
   */
  public TlsConnection( SSLSocket socket, String uri, Resources resources )
  {
    this( socket, new URL( uri ), resources );
  }
View Full Code Here

   * @param uri
   * @param resources
   */
  public TcpListener( String uri, Resources resources )
  {
    this( new URL( uri ), resources );
  }
View Full Code Here

   * @param uri
   * @param resources
   */
  public TlsListener( String uri, Resources resources )
  {
    this( new URL( uri ), resources );
  }
View Full Code Here

    Transport<ServerFactory> listener = ClosingHelper.newListener( uri, null, new MainClosingListener() );

    listener.transportControl( Transport.START_AND_WAIT_UP, 4000 );
   
    InetSocketAddress localAddr = (InetSocketAddress) listener.transportQuery( TcpListener.LOCAL_ADDRESS );
    URL u = new URL( "tcp:" );
    u.setHost( localAddr.getHostName() );
    u.setPort( localAddr.getPort() );
    localUri = u.toString();
  }
View Full Code Here

      new MainInheritanceListener() );

    listener.transportControl( Transport.START_AND_WAIT_UP, 4000 );
   
    InetSocketAddress localAddr = (InetSocketAddress) listener.transportQuery( TcpListener.LOCAL_ADDRESS );
    URL u = new URL( "tcp:" );
    u.setHost( localAddr.getHostName() );
    u.setPort( localAddr.getPort() );
    localUri = u.toString();
  }
View Full Code Here

{
  /** @throws Exception */
  @Test
  public void testImport() throws Exception
  {
    URL url = new URL( "scheme://user:pw@host:23/resource;s=1;t=2?p=3&q=4#frag" );
    test( url );
  }
View Full Code Here

    StructValue sv = helper.exportValue( vf, url );
//    System.out.println( "sv = "+sv );
   
    assertEquals( sv.type(), type );
   
    URL url2 = (URL) helper.importValue( sv );
//    System.out.println( "url2 = "+url2 );
   
    assertEquals( url, url2 );
  }
View Full Code Here

TOP

Related Classes of etch.util.URL

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.