as
Alejandro Acuña
2025-01-21 61cdfc6ee7f013c4533add51d797c1886b312883
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
package art.servers.transactionsserver.test.socket;
 
import art.library.interop.InteropParameter;
import art.library.interop.InteropParameters;
import art.library.interop.InteropResponse;
import art.library.interop.serialization.Serialization;
import art.library.interop.serialization.SerializationException;
import java.net.Socket;
 
public class TestSocketTransactionsGetIPAddress
{
 
    public static void main(String[] args)
    {
        try
        {
            //Socket socket = new Socket("83.142.189.115", 5001);
            Socket socket = new Socket("172.16.11.204", 5001);
 
            InteropParameters parameters = new InteropParameters();
            parameters.addParameter(new InteropParameter("operation", "getBlockedIPAddresses"));
            parameters.addParameter(new InteropParameter("language", "ca-ES"));
            InteropResponse response = (InteropResponse) Serialization.invoke("get", parameters, socket);
            Object[] object = response.getValue();
            
            parameters.setParameter(new InteropParameter("operation", "enableIPAddress"));
            parameters.addBodycontent(new String[]{"0:0:0:0:0:0:0:1"});
            InteropResponse response2 = (InteropResponse) Serialization.invoke("set", parameters, socket);
            Object[] object2 = response2.getValue();
        } catch (SerializationException e)
        {
            System.out.println(e.getStackMessage());
        } catch (Exception e)
        {
            e.printStackTrace();
        }
    }
}