String server = "213.61.220.27";  int port = 1500;  try { s = new Socket(server, port); out = new DataOutputStream(s.getOutputStream()); in = new DataInputStream(s.getInputStream()); } catch (UnknownHostException e) { throw new SmsException("Unknown host"); } catch (IOException e) { System.err.println ("SendSMS.send: Cannot open TCP/IP connection to: ".concat (server).concat(":").concat(String.valueOf(port))); throw new SmsException("Cannot connect to Server"); } catch (Exception e) { System.err.println ("SendSMS.send: Cannot open TCP/IP connection to: ".concat (server).concat(":").concat(String.valueOf(port))); throw new SmsException("Cannot connect to Server"); } System.out.println("Connected sucessfully to the target Host");
String strUCP60Uid, strUCP60Pwd; myIpHost = theProps.getProperty("smsj.ucp.ip.host"); myIpPort = Integer.parseInt(theProps.getProperty("smsj.ucp.ip.port")); strUCP60Uid = theProps.getProperty("smsj.ucp.ucp60.uid"); strUCP60Pwd = theProps.getProperty("smsj.ucp.ucp60.password"); if (strUCP60Uid == null || strUCP60Pwd == null) { myDoUCP60Login = false; } else if (strUCP60Uid == "") { throw new SmsException("UCP Transport: empty UCP60 username"); } else { myDoUCP60Login = true; }  try { myIpSocket = new Socket(myIpHost, myIpPort); myIpStreamOut = new DataOutputStream(myIpSocket.getOutputStream()); myIpStreamIn = new DataInputStream(myIpSocket.getInputStream()); } catch (UnknownHostException e) { throw new SmsException("UCP Transport: Unknown host " + myIpHost); } catch (IOException e) { throw new SmsException("UCP Transport: Cannot connect to SMSC at" + myIpHost + " on port " + String.valueOf(myIpPort)); } catch (Exception e) { throw new SmsException("UCP Transport: Cannot connect to SMSC at" + myIpHost + " on port " + String.valueOf(myIpPort)); }
    public void init(Properties theProps) throws SmsException    {    	//Normaly we sould get the Data from the Props, but temporaly hardCoded    	String server = "213.61.220.27";//    	server="10.2.1.107";   		int port = 1500;//		port = 3000;    	try {		    s = new Socket(server, port);		    out = new DataOutputStream(s.getOutputStream());		    in = new DataInputStream(s.getInputStream());		} catch (UnknownHostException e) {			throw new SmsException("Unknown host");		} catch (IOException e) {		    System.err.println			("SendSMS.send: Cannot open TCP/IP connection to: ".concat			     (server).concat(":").concat(String.valueOf(port)));			throw new SmsException("Cannot connect to Server");		} catch (Exception e) {		    System.err.println			("SendSMS.send: Cannot open TCP/IP connection to: ".concat			     (server).concat(":").concat(String.valueOf(port)));			throw new SmsException("Cannot connect to Server");		}		System.out.println("Connected sucessfully to the target Host");    }