Package programming5.net.sockets

Examples of programming5.net.sockets.TCPClient$TCPReceiver


            }
            receiver = new UDPReceiver(this, socket);
            receiver.start();
        }
        catch (SocketException se) {
            throw new NetworkException("UDPClient: Could not create datagram socket on the given port: " + se.getMessage());
        }
    }
View Full Code Here


                try {
                    hostPort = Integer.parseInt(portMsg);
                }
                catch (Exception e) {
                    fixedHost = false;
                    throw new NetworkException("UDPClient: Problem in connection with host: Bad port message: " + e.getMessage());
                }
            }
            catch (IOException ioe) {
                fixedHost = false;
                throw new NetworkException("UDPClient: Could not establish connection: " + ioe.getMessage());
            }
            finally {
                connect = false;
            }
        }
View Full Code Here

                DatagramPacket p = new DatagramPacket(packet, packet.length, hostAddress, hostPort);
                try {
                    socket.send(p);
                }
                catch (IOException e) {
                    throw new NetworkException("UDPClient: Could not send message: " + e.getMessage());
                }
            }
        }
        else throw new NetworkException("UDPClient: Could not send message: No remote host specified");
    }
View Full Code Here

        if (event instanceof AsynchMessageArrivedEvent) {
            String destAddress = ((AsynchMessageArrivedEvent) event).getSourceURL();
            if (destAddress != null) {
                send(msg, destAddress);
            }
            else throw new NetworkException("UDPClient: Cannot send reply: No message to reply to");
        }
        else throw new NetworkException("UDPClient: Cannot send reply: Arrived event does not contain return address");
    }
View Full Code Here

                DatagramPacket p = new DatagramPacket(packet, packet.length, dest, port);
                try {
                    socket.send(p);
                }
                catch (IOException e) {
                    throw new NetworkException("UDPClient: Could not send message: " + e.getMessage());
                }
            }
        }
        catch (UnknownHostException e) {
            throw new NetworkException("UDPClient: Cannot send message: Unknown host");
        }
    }
View Full Code Here

                DatagramPacket p = new DatagramPacket(packet, packet.length, hostAddress, hostPort);
                try {
                    socket.send(p);
                }
                catch (IOException e) {
                    throw new NetworkException("UDPClient: Could not send message: " + e.getMessage());
                }
            }
        }
        else throw new NetworkException("UDPClient: Could not send message: No remote host specified");
    }
View Full Code Here

        if (event instanceof AsynchMessageArrivedEvent) {
            String destAddress = ((AsynchMessageArrivedEvent) event).getSourceURL();
            if (destAddress != null) {
                send(msg, destAddress);
            }
            else throw new NetworkException("UDPClient: Cannot send reply: Return address not set");
        }
        else throw new NetworkException("UDPClient: Cannot send reply: Arrived event does not contain return address");
    }
View Full Code Here

                Debug.println("UDP packet length: " + Integer.toString(packet.length), "programming5.net.sockets.UDPClient");
                try {
                    socket.send(p);
                }
                catch (IOException e) {
                    throw new NetworkException("UDPClient: Could not send message: " + e.getMessage());
                }
            }
        }
        catch (UnknownHostException e) {
            throw new NetworkException("UDPClient: Cannot send message: Unknown host");
        }
    }
View Full Code Here

        try {
            URI urlObj = new URI(uri);
            this.send(message, urlObj.getHost(), urlObj.getPort());
        }
        catch (URISyntaxException use) {
            throw new NetworkException("UDPClient: Cannot send message: " + use.getMessage());
        }
    }
View Full Code Here

        try {
            URI urlObj = new URI(uri);
            this.send(bytesMessage, urlObj.getHost(), urlObj.getPort());
        }
        catch (URISyntaxException use) {
            throw new NetworkException("UDPClient: Cannot send message: " + use.getMessage());
        }
    }
View Full Code Here

TOP

Related Classes of programming5.net.sockets.TCPClient$TCPReceiver

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.