Search in sources :

Example 1 with PortMappingDelete

use of org.fourthline.cling.support.igd.callback.PortMappingDelete in project libresonic by Libresonic.

the class ClingRouter method deletePortMappingImpl.

private void deletePortMappingImpl(Service connectionService, int port) throws Exception {
    final Semaphore gotReply = new Semaphore(0);
    upnpService.getControlPoint().execute(new PortMappingDelete(connectionService, createPortMapping(port)) {

        @Override
        public void success(ActionInvocation invocation) {
            gotReply.release();
        }

        @Override
        public void failure(ActionInvocation invocation, UpnpResponse response, String defaultMsg) {
            gotReply.release();
        }
    });
    gotReply.acquire();
}
Also used : UpnpResponse(org.fourthline.cling.model.message.UpnpResponse) ActionInvocation(org.fourthline.cling.model.action.ActionInvocation) PortMappingDelete(org.fourthline.cling.support.igd.callback.PortMappingDelete) Semaphore(java.util.concurrent.Semaphore)

Aggregations

Semaphore (java.util.concurrent.Semaphore)1 ActionInvocation (org.fourthline.cling.model.action.ActionInvocation)1 UpnpResponse (org.fourthline.cling.model.message.UpnpResponse)1 PortMappingDelete (org.fourthline.cling.support.igd.callback.PortMappingDelete)1