stateblock NetConnectionNames augments RNetConnection {
requires NetAddressNames;
helper getLocalName () returns String {
if (local != null) {
return local.getName ();
} else {
return null;
}
}
helper getRemoteName () returns String {
if (remote != null) {
return remote.getName ();
} else {
return null;
}
}
helper getRemotePort () returns int {
if (remote != null) {
return remote.getPort ();
} else {
return -1;
}
}
helper getLocalPort () returns int {
if (local != null) {
return local.getPort ();
} else {
return -1;
}
}
helper getLocalHost () returns String {
if (local != null) {
return local.getName ();
} else {
return null;
}
}
helper isMulticast () returns boolean {
return remote.isMulticast ();
}
helper toString () returns String {
return
("{ " + (local != null ? local.toString () : "<null>") +
" => " + (remote != null ? remote.toString () : "<null>") +
" }");
}
}
Naccio Home Page
University of Virginia, Computer Science