aggiornamento codice
This commit is contained in:
@@ -1,2 +1,2 @@
|
|||||||
compile.on.save=true
|
compile.on.save=true
|
||||||
user.properties.file=/home/boss/.netbeans/16/build.properties
|
user.properties.file=/home/docente/.netbeans/16/build.properties
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
<group>
|
<group/>
|
||||||
<file>file:/home/boss/Progetti/TestClientSocket/src/testclientsocket/TestClientSocket.java</file>
|
|
||||||
</group>
|
|
||||||
</open-files>
|
</open-files>
|
||||||
</project-private>
|
</project-private>
|
||||||
|
|||||||
@@ -33,11 +33,15 @@ dist.javadoc.dir=${dist.dir}/javadoc
|
|||||||
dist.jlink.dir=${dist.dir}/jlink
|
dist.jlink.dir=${dist.dir}/jlink
|
||||||
dist.jlink.output=${dist.jlink.dir}/ClientAccademico
|
dist.jlink.output=${dist.jlink.dir}/ClientAccademico
|
||||||
excludes=
|
excludes=
|
||||||
|
file.reference.USocket-dist=../USocket/dist
|
||||||
file.reference.USocket.jar=lib/USocket.jar
|
file.reference.USocket.jar=lib/USocket.jar
|
||||||
|
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=\
|
javac.classpath=\
|
||||||
${file.reference.USocket.jar}
|
${file.reference.USocket.jar}:\
|
||||||
|
${file.reference.USocket-dist}:\
|
||||||
|
${file.reference.USocket.jar-1}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
compile.on.save=true
|
compile.on.save=true
|
||||||
user.properties.file=/home/boss/.netbeans/16/build.properties
|
user.properties.file=/home/docente/.netbeans/16/build.properties
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
<group>
|
<group/>
|
||||||
<file>file:/home/boss/Progetti/Didattica_Socket/ClientPersistente/src/clientpersistente/ClientPersistente.java</file>
|
|
||||||
</group>
|
|
||||||
</open-files>
|
</open-files>
|
||||||
</project-private>
|
</project-private>
|
||||||
|
|||||||
@@ -33,9 +33,11 @@ dist.javadoc.dir=${dist.dir}/javadoc
|
|||||||
dist.jlink.dir=${dist.dir}/jlink
|
dist.jlink.dir=${dist.dir}/jlink
|
||||||
dist.jlink.output=${dist.jlink.dir}/ClientPersistente
|
dist.jlink.output=${dist.jlink.dir}/ClientPersistente
|
||||||
excludes=
|
excludes=
|
||||||
|
file.reference.USocket.jar=../USocket/dist/USocket.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=
|
javac.classpath=\
|
||||||
|
${file.reference.USocket.jar}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|||||||
@@ -34,10 +34,12 @@ dist.jlink.dir=${dist.dir}/jlink
|
|||||||
dist.jlink.output=${dist.jlink.dir}/ClientSconnesso
|
dist.jlink.output=${dist.jlink.dir}/ClientSconnesso
|
||||||
excludes=
|
excludes=
|
||||||
file.reference.USocket.jar=/home/docente/Modelli/USocket.jar
|
file.reference.USocket.jar=/home/docente/Modelli/USocket.jar
|
||||||
|
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=\
|
javac.classpath=\
|
||||||
${file.reference.USocket.jar}
|
${file.reference.USocket.jar}:\
|
||||||
|
${file.reference.USocket.jar-1}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|||||||
@@ -34,10 +34,12 @@ dist.jlink.dir=${dist.dir}/jlink
|
|||||||
dist.jlink.output=${dist.jlink.dir}/ServerAccademico
|
dist.jlink.output=${dist.jlink.dir}/ServerAccademico
|
||||||
excludes=
|
excludes=
|
||||||
file.reference.USocket.jar=lib/USocket.jar
|
file.reference.USocket.jar=lib/USocket.jar
|
||||||
|
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=\
|
javac.classpath=\
|
||||||
${file.reference.USocket.jar}
|
${file.reference.USocket.jar}:\
|
||||||
|
${file.reference.USocket.jar-1}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|||||||
@@ -1,2 +1,2 @@
|
|||||||
compile.on.save=true
|
compile.on.save=true
|
||||||
user.properties.file=/home/boss/.netbeans/16/build.properties
|
user.properties.file=/home/docente/.netbeans/16/build.properties
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||||
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
<editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
|
||||||
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
<open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
|
||||||
<group>
|
<group/>
|
||||||
<file>file:/home/boss/Progetti/Didattica_Socket/ServerPersistente/src/serverpersistente/ServerPersistente.java</file>
|
|
||||||
</group>
|
|
||||||
</open-files>
|
</open-files>
|
||||||
</project-private>
|
</project-private>
|
||||||
|
|||||||
@@ -33,9 +33,11 @@ dist.javadoc.dir=${dist.dir}/javadoc
|
|||||||
dist.jlink.dir=${dist.dir}/jlink
|
dist.jlink.dir=${dist.dir}/jlink
|
||||||
dist.jlink.output=${dist.jlink.dir}/ServerPersistente
|
dist.jlink.output=${dist.jlink.dir}/ServerPersistente
|
||||||
excludes=
|
excludes=
|
||||||
|
file.reference.USocket.jar=../USocket/dist/USocket.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=
|
javac.classpath=\
|
||||||
|
${file.reference.USocket.jar}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|||||||
@@ -34,10 +34,12 @@ dist.jlink.dir=${dist.dir}/jlink
|
|||||||
dist.jlink.output=${dist.jlink.dir}/ServerSconnesso
|
dist.jlink.output=${dist.jlink.dir}/ServerSconnesso
|
||||||
excludes=
|
excludes=
|
||||||
file.reference.USocket.jar=/home/docente/Modelli/USocket.jar
|
file.reference.USocket.jar=/home/docente/Modelli/USocket.jar
|
||||||
|
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
|
||||||
includes=**
|
includes=**
|
||||||
jar.compress=false
|
jar.compress=false
|
||||||
javac.classpath=\
|
javac.classpath=\
|
||||||
${file.reference.USocket.jar}
|
${file.reference.USocket.jar}:\
|
||||||
|
${file.reference.USocket.jar-1}
|
||||||
# Space-separated list of extra javac options
|
# Space-separated list of extra javac options
|
||||||
javac.compilerargs=
|
javac.compilerargs=
|
||||||
javac.deprecation=false
|
javac.deprecation=false
|
||||||
|
|||||||
2
USocket/.gitignore
vendored
2
USocket/.gitignore
vendored
@@ -1 +1 @@
|
|||||||
/build/
|
/build/
|
||||||
@@ -70,4 +70,4 @@
|
|||||||
nbproject/build-impl.xml file.
|
nbproject/build-impl.xml file.
|
||||||
|
|
||||||
-->
|
-->
|
||||||
</project>
|
</project>
|
||||||
BIN
USocket/dist/USocket.jar
vendored
BIN
USocket/dist/USocket.jar
vendored
Binary file not shown.
@@ -1,6 +1,6 @@
|
|||||||
build.xml.data.CRC32=73e21a97
|
build.xml.data.CRC32=73e21a97
|
||||||
build.xml.script.CRC32=905bb893
|
build.xml.script.CRC32=905bb893
|
||||||
build.xml.stylesheet.CRC32=f85dc8f2@1.102.0.48
|
build.xml.stylesheet.CRC32=f85dc8f2@1.105.0.48
|
||||||
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
# This file is used by a NetBeans-based IDE to track changes in generated files such as build-impl.xml.
|
||||||
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
# Do not edit this file. You may delete it but then the IDE will never regenerate such files for you.
|
||||||
nbproject/build-impl.xml.data.CRC32=73e21a97
|
nbproject/build-impl.xml.data.CRC32=73e21a97
|
||||||
|
|||||||
@@ -10,6 +10,13 @@ public class UDatagram {
|
|||||||
|
|
||||||
static final int dim_buffer = 1024;
|
static final int dim_buffer = 1024;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inizializza un DatagramSocket server in ascolto sulla porta scelta e restituisce il messaggio una volta ricevuto da remoto
|
||||||
|
* @param porta Porta che userà il server per rimanere in ascolto
|
||||||
|
* @return stringa contenente il messaggio ricevuto da remoto
|
||||||
|
* @throws SocketException
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
public static String listenString(int porta) throws SocketException, IOException {
|
public static String listenString(int porta) throws SocketException, IOException {
|
||||||
|
|
||||||
DatagramSocket server = new DatagramSocket(porta);
|
DatagramSocket server = new DatagramSocket(porta);
|
||||||
@@ -27,6 +34,13 @@ public class UDatagram {
|
|||||||
return messaggio;
|
return messaggio;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Inizializza un DatagramSocket lato client che trasmette il messaggio scelto all'indirizzo e alla porta passata come parametro
|
||||||
|
* @param host Indirizzo IP del destinatario
|
||||||
|
* @param porta Porta del server remoto in ascolto
|
||||||
|
* @param messaggio Messaggio da trasmettere al server remoto
|
||||||
|
* @throws IOException
|
||||||
|
*/
|
||||||
public static void writeString(String host, int porta, String messaggio) throws IOException {
|
public static void writeString(String host, int porta, String messaggio) throws IOException {
|
||||||
|
|
||||||
InetAddress destinatario = InetAddress.getByName(host);
|
InetAddress destinatario = InetAddress.getByName(host);
|
||||||
|
|||||||
Reference in New Issue
Block a user