diff --git a/i2p2www/pages/site/get-involved/develop/applications.html b/i2p2www/pages/site/get-involved/develop/applications.html index db4eae61..5f70fa41 100644 --- a/i2p2www/pages/site/get-involved/develop/applications.html +++ b/i2p2www/pages/site/get-involved/develop/applications.html @@ -302,7 +302,7 @@ and creating an I2PServerSocket. In addition, we will ask the I2PSocketManager for an I2PSession, so we can find out the Destination we use. {%- endtrans %}

-
+{% highlight lang='java' %}
     package i2p.echoserver;
 
     import net.i2p.client.I2PSession;
@@ -322,8 +322,7 @@ In addition, we will ask the I2PSocketManager for an I2PSession, so we can find
         }
 
     }
-    
-

+{% endhighlight %}

{{ _('Code example 1: initializing the server application.') }}

{% trans -%} @@ -335,11 +334,10 @@ Once we have created the I2PSocket instance, we read data, print it and send it The bold code is the new code we add. {%- endtrans %}

-
+{% highlight lang='java',
+hl_lines=[3,4,5,6,7,8,9,10,25,26,27,28,29,32,34,35,36,38,39,40,41,42,43,44,45,46,47,48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,65,67] %}
     package i2p.echoserver;
 
-    
-

     import java.io.IOException;
     import java.io.InputStream;
     import java.io.OutputStream;
@@ -348,8 +346,7 @@ The bold code is the new code we add.
     import net.i2p.I2PException;
     import net.i2p.client.streaming.I2PSocket;
     import net.i2p.util.I2PThread;
-    
-
+
     import net.i2p.client.I2PSession;
     import net.i2p.client.streaming.I2PServerSocket;
     import net.i2p.client.streaming.I2PSocketManager;
@@ -362,8 +359,6 @@ The bold code is the new code we add.
             I2PServerSocket serverSocket = manager.getServerSocket();
             I2PSession session = manager.getSession();
             System.out.println(session.getMyDestination().toBase64()); //Print the base64 string, the regular string would look like garbage.
-
-

 
             //Create socket to handle clients
             I2PThread t = new I2PThread(new ClientHandler(serverSocket));
@@ -410,8 +405,7 @@ The bold code is the new code we add.
         }
 
     }
-    
-

+{% endhighlight %}

{{ _('Code example 2: accepting connections from clients and handling messages.') }}

@@ -443,7 +437,7 @@ We will ask the user for the Destination string, and create an I2PSocket using t Once we have an I2PSocket, we can start sending and receiving data to and from the server. {%- endtrans %}

-
+{% highlight lang='java' %}
     package i2p.echoclient;
 
     import java.io.BufferedReader;
@@ -514,8 +508,7 @@ Once we have an I2PSocket, we can start sending and receiving data to and from t
         }
 
     }
-    
-

+{% endhighlight %}

{{ _('Code example 3: starting the client and connecting it to the server application.') }}

{% trans -%}