BlinkenArea - GitList
Repositories
Blog
Wiki
BlinkenSimJava
Code
Commits
Branches
Tags
Search
Tree:
16048cb
Branches
Tags
master
v0.1
v0.1.1
v0.2
BlinkenSimJava
DynMcufClient.java
BlinkenSimJava v.0.1 (2004-06-29)
Christian Heimke
commited
16048cb
at 2011-07-15 09:12:42
DynMcufClient.java
Blame
History
Raw
import java.lang.*; import java.applet.*; import java.awt.*; import java.io.*; import java.net.*; public class DynMcufClient { private DatagramSocket sock = null; private InetAddress host; private int port; private DynMcufClientSend send; private DynMcufClientRecv recv; public void start( String hostname, int port, FrameReceiver receiver ) { stop( ); try { sock = new DatagramSocket( ); host = InetAddress.getByName( hostname ); this.port = port; send = new DynMcufClientSend( sock, host, port ); recv = new DynMcufClientRecv( sock, host, port, receiver ); recv.start( ); send.start( ); } catch( SocketException e ) { sock = null; host = null; port = 0; } catch( UnknownHostException e ) { sock = null; host = null; port = 0; } } public void stop( ) { sock = null; host = null; port = 0; if( send != null ) { send.terminate( ); send = null; } if( recv != null ) { recv.terminate( ); recv = null; } } }