User Tools

Site Tools


runtime_evolution

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
runtime_evolution [2014/01/16 08:49]
barryfp
runtime_evolution [2014/02/06 14:11]
barryfp
Line 50: Line 50:
  
 component provides App requires net.TCPServerSocket,​ net.TCPSocket,​ data.Source source { component provides App requires net.TCPServerSocket,​ net.TCPSocket,​ data.Source source {
-   ​TCPSocket clients[]; 
        
-   void handleStream(TCPSocket ​*client)+   void handleStream(TCPSocket client)
       {       {
       SourceReply reply;       SourceReply reply;
Line 58: Line 57:
       client.send((serial) reply);       client.send((serial) reply);
       client.disconnect();​       client.disconnect();​
-      clients -= client; 
       }       }
        
    int App:​main(AppParam params[])    int App:​main(AppParam params[])
       {       {
-      TCPServerSocket master;+      TCPServerSocket master ​= new TCPServerSocket();
       master.bind("​ANY",​ 2014);       master.bind("​ANY",​ 2014);
       ​       ​
       while (true)       while (true)
          {          {
-         ​TCPSocket ​*client = clients ++;+         ​TCPSocket client = new TCPSocket();
          if (client.accept(master))          if (client.accept(master))
             handleStream(client);​             handleStream(client);​
Line 85: Line 83:
    int App:​main(AppParam params[])    int App:​main(AppParam params[])
       {       {
-      TCPSocket client;+      TCPSocket client ​= new TCPSocket();
       ​       ​
       while (true)       while (true)
Line 93: Line 91:
             SourceReply reply;             SourceReply reply;
             ​             ​
-            client.recv((serial) reply);+            ​((serial) reply) =[] client.recv(((serial) reply).arrayLength);
             ​             ​
             out.println(iu.intToString(reply.number));​             out.println(iu.intToString(reply.number));​
Line 122: Line 120:
       }       }
        
-   bool Source:​clone(Object ​*o)+   bool Source:​clone(Object o)
       {       {
-      Source ​*src = o;+      Source src = o;
       ​       ​
       number = src.getNumber();​       number = src.getNumber();​
Line 148: Line 146:
       }       }
        
-   bool Source:​clone(Object ​*o)+   bool Source:​clone(Object o)
       {       {
-      Source ​*s = o;+      Source s = o;
       ​       ​
       myNum = s.getNumber();​       myNum = s.getNumber();​
runtime_evolution.txt ยท Last modified: 2014/02/06 14:11 by barryfp