OpenCores
URL https://opencores.org/ocsvn/udp_ip_stack/udp_ip_stack/trunk

Subversion Repositories udp_ip_stack

[/] [udp_ip_stack/] [tags/] [v1.0/] [sw/] [UDPTest.java] - Diff between revs 2 and 3

Only display areas with differences | Details | Blame | View Log

Rev 2 Rev 3
package com.pjf;
package com.pjf;
 
 
import java.io.IOException;
import java.io.IOException;
import java.net.SocketException;
import java.net.SocketException;
import java.net.UnknownHostException;
import java.net.UnknownHostException;
 
 
public class UDPTest {
public class UDPTest {
        private UDPCxn cxn;
        private UDPCxn cxn;
 
 
        public UDPTest() throws SocketException, UnknownHostException {
        public UDPTest() throws SocketException, UnknownHostException {
                cxn = new UDPCxn("192.168.5.9");
                cxn = new UDPCxn("192.168.5.9");
        }
        }
 
 
        public void go() throws IOException {
        public void go() throws IOException {
                String fix1 = "1=45~34=201~18=23~";
                String fix1 = "1=45~34=201~18=23~";
                cxn.fixSend(fix1, 2000, true);
                cxn.fixSend(fix1, 2000, true);
                byte[] rep = cxn.rcv();
                byte[] rep = cxn.rcv();
                String reply = new String(rep);
                String reply = new String(rep);
                System.out.println("Got [" + reply + "]");
                System.out.println("Got [" + reply + "]");
        }
        }
 
 
 
 
        public static void main(String[] args) {
        public static void main(String[] args) {
                UDPTest ut;
                UDPTest ut;
                try {
                try {
                        ut = new UDPTest();
                        ut = new UDPTest();
                        ut.go();
                        ut.go();
                } catch (Exception e) {
                } catch (Exception e) {
                        e.printStackTrace();
                        e.printStackTrace();
                }
                }
        }
        }
 
 
 
 
}
}
 
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.