com.ibm.as400.access.PingReplyDS Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jt400 Show documentation
Show all versions of jt400 Show documentation
The Open Source version of the IBM Toolbox for Java
///////////////////////////////////////////////////////////////////////////////
//
// JTOpen (IBM Toolbox for Java - OSS version)
//
// Filename: SignonInfoRep.java
//
// The source code contained herein is licensed under the IBM Public License
// Version 1.0, which has been approved by the Open Source Initiative.
// Copyright (C) 1997-2007 International Business Machines Corporation and
// others. All rights reserved.
//
///////////////////////////////////////////////////////////////////////////////
package com.ibm.as400.access;
import java.io.IOException;
import java.io.InputStream;
class PingReplyDS extends ClientAccessDataStream
{
/**
Generate a new instance of this type.
@return a reference to the new instance
**/
public Object getNewDataStream()
{
return new PingReplyDS();
}
int getPingResponse() {
return get32bit(0);
}
void read(InputStream in) throws IOException
{
if (Trace.traceOn_) Trace.log(Trace.DIAGNOSTIC, "Receiving ping response...");
// Receive the header.
byte[] header = new byte[20];
if (readFromStream(in, header, 0, 20) < 20)
{
if (Trace.traceOn_) Trace.log(Trace.ERROR, "Failed to read all of ping reply header.");
throw new ConnectionDroppedException(ConnectionDroppedException.CONNECTION_DROPPED);
}
}
/**
Generates a hash code for this data stream.
@return the hash code
**/
public int hashCode()
{
return 0xFFFE;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy