Package de.fhkn.in.uce.relaying.message

Examples of de.fhkn.in.uce.relaying.message.RelayingLifetime


                peerSocketListener.start();
                Message successResponse = relayAllocationMessage.buildSuccessResponse();
                successResponse.addAttribute(new XorMappedAddress(new InetSocketAddress(peerSS.getInetAddress(), peerSS
                        .getLocalPort())));
                successResponse.addAttribute(new EndpointClass(EndpointCategory.RELAY));
                successResponse.addAttribute(new RelayingLifetime(lifetime));
                controlConnectionWriter.writeMessage(successResponse);
            }
        } catch (IOException e) {
            logger.error("IOException while handling allocation request: {}", e);
        }
View Full Code Here


                    if (lifetime > 0) {
                        refreshInterval = (lifetime < RelayingConstants.ALLOCATION_LIFETIME_MAX) ? lifetime
                                : RelayingConstants.ALLOCATION_LIFETIME_MAX;
                        // send refresh response
                        Message successResponse = message.buildSuccessResponse();
                        successResponse.addAttribute(new RelayingLifetime(refreshInterval));
                        controlConnectionWriter.writeMessage(successResponse);
                    } else {
                        // send refresh response (unallocate)
                        Message successResponse = message.buildSuccessResponse();
                        successResponse.addAttribute(new RelayingLifetime(0));
                        controlConnectionWriter.writeMessage(successResponse);
                        break;
                    }
                } else {
                    logger.error("Received unexpected message: {}", message.getMessageMethod());
View Full Code Here

    @Override
    public void run() {
        try {
            final Message refreshRequestMessage = MessageStaticFactory.newSTUNMessageInstance(STUNMessageClass.REQUEST,
                    STUNMessageMethod.KEEP_ALIVE);
            refreshRequestMessage.addAttribute(new RelayingLifetime(this.lifetime));
            this.controlConnectionWriter.writeMessage(refreshRequestMessage);
        } catch (final IOException e) {
            logger.error("IOException while sending refresh request"); //$NON-NLS-1$
        }
    }
View Full Code Here

    }

    private synchronized void sendAllocationRequest() throws IOException {
        final Message allocationRequest = MessageStaticFactory.newSTUNMessageInstance(STUNMessageClass.REQUEST,
                RelayingMethod.ALLOCATION);
        allocationRequest.addAttribute(new RelayingLifetime(ALLOCATION_LIFETIME));
        logger.debug("Sending allocation request to relay server"); //$NON-NLS-1$
        this.controlConnectionWriter.writeMessage(allocationRequest);
    }
View Full Code Here

    }

    private synchronized void sendDiscardMessage() throws IOException {
        final Message refreshRequestMessage = MessageStaticFactory.newSTUNMessageInstance(STUNMessageClass.REQUEST,
                STUNMessageMethod.KEEP_ALIVE);
        refreshRequestMessage.addAttribute(new RelayingLifetime(0));
        this.controlConnectionWriter.writeMessage(refreshRequestMessage);
    }
View Full Code Here

TOP

Related Classes of de.fhkn.in.uce.relaying.message.RelayingLifetime

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.