alexgaga
asked on
Use ASN.1 description to send an integer with socket
Hello,
this is my ASN.1 description
I have a code who send an integer to a server , it work perfectly
But I tried to use the ASN.1 classes and i have a problem, I tried the following code, but I have an error in the setValue method
this is my ASN.1 description
Demo-module DEFINITIONS ::= -- Module-name DEFINITIONS ::= BEGIN
BEGIN
ClientFirstRequest ::= SEQUENCE {
clientInt INTEGER
}
ServerFirstResponse ::= SEQUENCE {
serverInt INTEGER ,
serverString IA5String
}
ClientSecondRequest ::= SEQUENCE {
clientString IA5String
}
ServerSecondResponse ::= SEQUENCE {
serverResponse IA5String
}
END -- end of module, END required
I have a code who send an integer to a server , it work perfectly
DataOutputStream dos = new DataOutputStream(_socket.getOutputStream());
dos.writeInt(4);
But I tried to use the ASN.1 classes and i have a problem, I tried the following code, but I have an error in the setValue method
ClientFirstRequest h = new ClientFirstRequest();
h.setValue(4);
BerOutputStream bos = new BerOutputStream(_socket.getOutputStream());
h.encode(bos);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.