protected void sendMessage() throws IOException {
if (smscListener != null) {
int procCount = processors.count();
if (procCount > 0) {
String client;
SimulatorPDUProcessor proc;
listClients();
if (procCount > 1) {
System.out.print("Type name of the destination> ");
client = keyboard.readLine();
} else {
proc = (SimulatorPDUProcessor) processors.get(0);
client = proc.getSystemId();
}
for (int i = 0; i < procCount; i++) {
proc = (SimulatorPDUProcessor) processors.get(i);
if (proc.getSystemId().equals(client)) {
if (proc.isActive()) {
System.out.print("Type the message> ");
String message = keyboard.readLine();
DeliverSM request = new DeliverSM();
try {
request.setShortMessage(message);
proc.serverRequest(request);
System.out.println("Message sent.");
} catch (WrongLengthOfStringException e) {
System.out.println("Message sending failed");
event.write(e, "");
} catch (IOException ioe) {