public SMGPSMProxy(Args args) { conn = new SMGPConnection(args); conn.addEventListener(new SMGPEventAdapter(this)); conn.waitAvailable(); if (!conn.available()) throw new IllegalStateException(conn.getError()); else return; }
public SMGPMessage send(SMGPMessage message) throws IOException { if (message == null) return null; SMGPTransaction t = (SMGPTransaction) conn.createChild(); try { t.send(message); t.waitResponse(); SMGPMessage rsp = t.getResponse(); SMGPMessage smgpmessage = rsp; return smgpmessage; } finally { t.close(); } }
public String getConnState() { return conn.getError(); }
public void close() { conn.close(); }