aggiornamento codice

This commit is contained in:
2023-02-03 12:49:06 +01:00
parent e02d5b50a9
commit f316e7a997
17 changed files with 43 additions and 21 deletions

View File

@@ -1,2 +1,2 @@
compile.on.save=true
user.properties.file=/home/boss/.netbeans/16/build.properties
user.properties.file=/home/docente/.netbeans/16/build.properties

View File

@@ -2,8 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<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">
<group>
<file>file:/home/boss/Progetti/TestClientSocket/src/testclientsocket/TestClientSocket.java</file>
</group>
<group/>
</open-files>
</project-private>

View File

@@ -33,11 +33,15 @@ dist.javadoc.dir=${dist.dir}/javadoc
dist.jlink.dir=${dist.dir}/jlink
dist.jlink.output=${dist.jlink.dir}/ClientAccademico
excludes=
file.reference.USocket-dist=../USocket/dist
file.reference.USocket.jar=lib/USocket.jar
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
includes=**
jar.compress=false
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
javac.compilerargs=
javac.deprecation=false

View File

@@ -1,2 +1,2 @@
compile.on.save=true
user.properties.file=/home/boss/.netbeans/16/build.properties
user.properties.file=/home/docente/.netbeans/16/build.properties

View File

@@ -2,8 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<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">
<group>
<file>file:/home/boss/Progetti/Didattica_Socket/ClientPersistente/src/clientpersistente/ClientPersistente.java</file>
</group>
<group/>
</open-files>
</project-private>

View File

@@ -33,9 +33,11 @@ dist.javadoc.dir=${dist.dir}/javadoc
dist.jlink.dir=${dist.dir}/jlink
dist.jlink.output=${dist.jlink.dir}/ClientPersistente
excludes=
file.reference.USocket.jar=../USocket/dist/USocket.jar
includes=**
jar.compress=false
javac.classpath=
javac.classpath=\
${file.reference.USocket.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false

View File

@@ -34,10 +34,12 @@ dist.jlink.dir=${dist.dir}/jlink
dist.jlink.output=${dist.jlink.dir}/ClientSconnesso
excludes=
file.reference.USocket.jar=/home/docente/Modelli/USocket.jar
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.USocket.jar}
${file.reference.USocket.jar}:\
${file.reference.USocket.jar-1}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false

View File

@@ -34,10 +34,12 @@ dist.jlink.dir=${dist.dir}/jlink
dist.jlink.output=${dist.jlink.dir}/ServerAccademico
excludes=
file.reference.USocket.jar=lib/USocket.jar
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.USocket.jar}
${file.reference.USocket.jar}:\
${file.reference.USocket.jar-1}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false

View File

@@ -1,2 +1,2 @@
compile.on.save=true
user.properties.file=/home/boss/.netbeans/16/build.properties
user.properties.file=/home/docente/.netbeans/16/build.properties

View File

@@ -2,8 +2,6 @@
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
<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">
<group>
<file>file:/home/boss/Progetti/Didattica_Socket/ServerPersistente/src/serverpersistente/ServerPersistente.java</file>
</group>
<group/>
</open-files>
</project-private>

View File

@@ -33,9 +33,11 @@ dist.javadoc.dir=${dist.dir}/javadoc
dist.jlink.dir=${dist.dir}/jlink
dist.jlink.output=${dist.jlink.dir}/ServerPersistente
excludes=
file.reference.USocket.jar=../USocket/dist/USocket.jar
includes=**
jar.compress=false
javac.classpath=
javac.classpath=\
${file.reference.USocket.jar}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false

View File

@@ -34,10 +34,12 @@ dist.jlink.dir=${dist.dir}/jlink
dist.jlink.output=${dist.jlink.dir}/ServerSconnesso
excludes=
file.reference.USocket.jar=/home/docente/Modelli/USocket.jar
file.reference.USocket.jar-1=../USocket/dist/USocket.jar
includes=**
jar.compress=false
javac.classpath=\
${file.reference.USocket.jar}
${file.reference.USocket.jar}:\
${file.reference.USocket.jar-1}
# Space-separated list of extra javac options
javac.compilerargs=
javac.deprecation=false

2
USocket/.gitignore vendored
View File

@@ -1 +1 @@
/build/
/build/

View File

@@ -70,4 +70,4 @@
nbproject/build-impl.xml file.
-->
</project>
</project>

Binary file not shown.

View File

@@ -1,6 +1,6 @@
build.xml.data.CRC32=73e21a97
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.
# 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

View File

@@ -10,6 +10,13 @@ public class UDatagram {
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 {
DatagramSocket server = new DatagramSocket(porta);
@@ -27,6 +34,13 @@ public class UDatagram {
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 {
InetAddress destinatario = InetAddress.getByName(host);