Subversion Repositories Projects

Rev

Rev 82 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 82 Rev 149
Line 3... Line 3...
3
 
3
 
4
public class MKProxy
4
public class MKProxy
5
 implements  Runnable
5
 implements  Runnable
Line -... Line 6...
-
 
6
{
-
 
7
 
-
 
8
    public boolean connected;
6
{
9
    public String url;
7
 
10
   
Line 8... Line 11...
8
    public String err_str="none";
11
    public String err_str="none";
9
    StreamConnection connection;
12
    StreamConnection connection;
Line 10... Line 13...
10
 
13
 
11
    public java.io.InputStream  reader;    
14
    public java.io.InputStream  reader;    
-
 
15
     public java.io.OutputStream writer;    
-
 
16
 
12
    public java.io.OutputStream writer;    
17
    public void connect(String url_)
13
 
18
    {
14
    public MKProxy(String url)
19
        url=url_;
15
    {
20
 
16
        try
21
        try
-
 
22
            {
-
 
23
                connection = (StreamConnection) Connector.open(url, Connector.READ_WRITE);
-
 
24
                reader=connection.openInputStream();
-
 
25
                writer=connection.openOutputStream();
-
 
26
                connected=true;
-
 
27
            }
-
 
28
       
Line -... Line 29...
-
 
29
        catch (Exception e)
-
 
30
            {
Line 17... Line 31...
17
            {
31
                //              err_str=e.toString();
-
 
32
                //              this=null;
18
                connection = (StreamConnection) Connector.open(url, Connector.READ_WRITE);
33
 
19
                reader=connection.openInputStream();
34
                connected=false;
-
 
35
            }
20
                writer=connection.openOutputStream();
36
 
-
 
37
    }
-
 
38
 
21
       
39
    public void write(int input)
-
 
40
    {
22
 
41
        if (connected)
Line 23... Line 42...
23
            }
42
            try{ writer.write(input);
24
        catch (Exception e)
43
            if (input==13) writer.flush();
25
            {
44