File tree Expand file tree Collapse file tree 2 files changed +26
-7
lines changed
main/java/org/epics/pva/client
test/java/org/epics/pva/client Expand file tree Collapse file tree 2 files changed +26
-7
lines changed Original file line number Diff line number Diff line change @@ -151,9 +151,17 @@ public void handleResponse(final ByteBuffer buffer) throws Exception
151151 fail (new Exception ("Incomplete Put Response" ));
152152 final int request_id = buffer .getInt ();
153153 final byte subcmd = buffer .get ();
154- PVAStatus status = PVAStatus .decode (buffer );
154+ final PVAStatus status = PVAStatus .decode (buffer );
155155 if (! status .isSuccess ())
156- fail (new Exception (channel + " Put Response for " + request + ": " + status ));
156+ {
157+ // Server reported an error with text like "Put not permitted"
158+ // for EPICS 7.0.6 QSRV.
159+ // Channel access similarly provided an Exception with text
160+ // "No write access rights granted."
161+ // Not trying to parse the message; passing it up with added
162+ // channel name and request info.
163+ fail (new Exception (channel + " Write for '" + channel .getName () + "' " + request + " failed with " + status ));
164+ }
157165
158166 if (subcmd == PVAHeader .CMD_SUB_INIT )
159167 {
Original file line number Diff line number Diff line change @@ -94,12 +94,23 @@ public void testGet() throws Exception
9494 final PVAChannel ch2 = pva .getChannel ("saw" , listener );
9595 CompletableFuture .allOf (ch1 .connect (), ch2 .connect ()).get (5 , TimeUnit .SECONDS );
9696
97+ System .out .println ("Connected.. Stop IOC in next 10 seconds to test disconnect" );
98+ TimeUnit .SECONDS .sleep (10 );
99+
97100 // Get data
98- Future <PVAStructure > data = ch1 .read ("" );
99- System .out .println (ch1 .getName () + " = " + data .get ());
101+ try
102+ {
103+ Future <PVAStructure > data = ch1 .read ("" );
104+ System .out .println (ch1 .getName () + " = " + data .get ());
100105
101- data = ch2 .read ("" );
102- System .out .println (ch2 .getName () + " = " + data .get ());
106+ data = ch2 .read ("" );
107+ System .out .println (ch2 .getName () + " = " + data .get ());
108+ }
109+ catch (Exception ex )
110+ {
111+ System .out .println ("Read failed" );
112+ ex .printStackTrace ();
113+ }
103114
104115 // Close channels
105116 ch2 .close ();
@@ -264,7 +275,7 @@ public void testStatic() throws Exception
264275 }
265276
266277 /** Write ('put') test
267- *
278+ *
268279 * Includes a pause to allow manual stopping of the server.
269280 *
270281 * May be used with read-only access security on IOC
You can’t perform that action at this time.
0 commit comments