Added highlighting to get-involved/develop/applications

This commit is contained in:
str4d
2013-04-25 04:57:05 +00:00
parent cf7b010efc
commit f2bb84c45f

View File

@@ -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 %}</p>
<div class="box">
<pre>
{% 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
}
}
</pre>
<br /><br />
{% endhighlight %}
<p style="text-align:center">{{ _('Code example 1: initializing the server application.') }}</p>
</div>
<p>{% 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 %}</p>
<div class="box">
<pre>
{% 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;
</pre>
<pre><b>
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;
</b></pre>
<pre>
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.
</pre>
<pre><b>
//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.
}
}
</b></pre>
<br /><br />
{% endhighlight %}
<p style="text-align:center">{{ _('Code example 2: accepting connections from clients and handling messages.') }}</p>
</div>
@@ -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 %}</p>
<div class="box">
<pre>
{% 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
}
}
</pre>
<br /><br />
{% endhighlight %}
<p style="text-align:center">{{ _('Code example 3: starting the client and connecting it to the server application.') }}</p>
</div>
<p>{% trans -%}