Package erjang

Examples of erjang.EPort


  }

  @BIF
 
  static public EString port_to_list(EObject obj) {
    EPort port;
    if ((port = obj.testPort()) != null) {
      return port.getName();
    }
    throw ERT.badarg(obj);
  }
View Full Code Here


  }

  private int tcp_sendv(ByteBuffer[] ev) throws Pausable {
    int sz;
    EPort ix = port();
    long len = remaining(ev);
    ByteBuffer hbuf = null;

    switch (htype) {
    case TCP_PB_1:
View Full Code Here

    throw ERT.badarg(portName, portSetting);
  }

  @BIF
  static public EObject port_close(EProc proc, EObject port) throws Pausable {
    EPort p;
    if ((p = port.testPort()) == null) {

      EObject obj = ERT.whereis(port);

      if (obj == ERT.am_undefined || ((p = obj.testPort()) == null)) {
        throw ERT.badarg(port);
      }
    }

    if (!p.isOpen()) {
      throw ERT.badarg(port);
    }

    proc.unlink(p);

    p.close();

    return ERT.TRUE;
  }
View Full Code Here

    return EDriverTask.all_ports();
  }
 
  @BIF
  static public EObject port_info(EProc proc, EObject a1, EObject a2) {
    EPort p = a1.testPort();
    EAtom spec = a2.testAtom();
    if (p==null || spec==null) throw ERT.badarg();
    EObject info = p.port_info(spec);
    //log.finer(""+proc.self_handle()+"::port_info ("+a1+") => "+info);
    return info;
  }
View Full Code Here

    return info;
  }
 
  @BIF
  static public EObject port_set_data(EObject port, EObject data) {
    EPort p = id_or_name2port(port);
    if (p == null) {
      throw ERT.badarg(port, data);
    }

    p.set_data(data);
   
    return data;
  }
View Full Code Here

    return data;
  }
 
  @BIF
  static public EObject port_get_data(EObject port) {
    EPort p = id_or_name2port(port);
    if (p == null) {
      throw ERT.badarg(port);
    }
   
    return p.get_data();
  }
View Full Code Here

   
    return p.get_data();
  }

  private static EPort id_or_name2port(EObject port) {
    EPort p = port.testPort();
    if (p != null) return p;
     
    EObject p2 = ERT.whereis(port);
   
    // p2 is ERT.am_undefined if not found
View Full Code Here

TOP

Related Classes of erjang.EPort

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.