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

Subversion Repositories udp_ip_stack

[/] [udp_ip_stack/] [trunk/] [sw/] [UDPTest.java] - Blame information for rev 4

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 2 pjf
package com.pjf;
2
 
3
import java.io.IOException;
4
import java.net.SocketException;
5
import java.net.UnknownHostException;
6
 
7
public class UDPTest {
8
        private UDPCxn cxn;
9
 
10
        public UDPTest() throws SocketException, UnknownHostException {
11
                cxn = new UDPCxn("192.168.5.9");
12
        }
13
 
14
        public void go() throws IOException {
15
                String fix1 = "1=45~34=201~18=23~";
16
                cxn.fixSend(fix1, 2000, true);
17
                byte[] rep = cxn.rcv();
18
                String reply = new String(rep);
19
                System.out.println("Got [" + reply + "]");
20
        }
21
 
22
 
23
        public static void main(String[] args) {
24
                UDPTest ut;
25
                try {
26
                        ut = new UDPTest();
27
                        ut.go();
28
                } catch (Exception e) {
29
                        e.printStackTrace();
30
                }
31
        }
32
 
33
 
34
}

powered by: WebSVN 2.1.0

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