public class SecurityConnection extends Object implements Connection, PayloadSender<NotifyPayload>
| 限定符和类型 | 方法和说明 |
|---|---|
void |
close()
close.
|
void |
flush()
flush.
|
int |
getId()
Getter for the field
id. |
protected InputStream |
in()
in.
|
static SecurityConnection |
newSecurityConnection(SecuritySocketFactory securitySocketFactory)
newSecurityConnection.
|
static SecurityConnection |
newSecurityConnection(SecuritySocketFactory securitySocketFactory,
int tryTimes)
newSecurityConnection.
|
protected OutputStream |
out()
out.
|
ErrorResponse |
readErrorResponse()
readErrorResponse.
|
int |
recv(byte[] data)
Reads some number of bytes from the connection and stores them into
the buffer array
data. |
void |
send(byte[] data)
Writes
data.length bytes from the specified byte array
to this connection |
void |
sendAndFlush(byte[] deviceTokenBytes,
NotifyPayload notifyPayload)
Send a payload with a devicetoken bytes(32 bytes)
|
void |
sendAndFlush(String deviceTokenString,
NotifyPayload notifyPayload)
Send a payload with a devicetoken string(length 64)
|
protected void |
socket()
socket.
|
public static SecurityConnection newSecurityConnection(SecuritySocketFactory securitySocketFactory)
newSecurityConnection.
securitySocketFactory - a SecuritySocketFactory object.SecurityConnection object.public static SecurityConnection newSecurityConnection(SecuritySocketFactory securitySocketFactory, int tryTimes)
newSecurityConnection.
securitySocketFactory - a SecuritySocketFactory object.tryTimes - a int.SecurityConnection object.public void flush()
throws IOException
flush.
IOException - if any.public void sendAndFlush(byte[] deviceTokenBytes,
NotifyPayload notifyPayload)
throws IOException
sendAndFlush 在接口中 PayloadSender<NotifyPayload>deviceTokenBytes - an array of byte.notifyPayload - a NotifyPayload object.IOException - if any.public void sendAndFlush(String deviceTokenString, NotifyPayload notifyPayload) throws IOException
sendAndFlush 在接口中 PayloadSender<NotifyPayload>deviceTokenString - a String object.notifyPayload - a NotifyPayload object.IOException - if any.public ErrorResponse readErrorResponse() throws IOException
readErrorResponse.
ErrorResponse object.IOException - if any.public void close()
close.
close 在接口中 Closeableclose 在接口中 AutoCloseablepublic void send(byte[] data)
throws IOException
data.length bytes from the specified byte array
to this connectionsend 在接口中 Connectiondata - an array of byte.IOException - if any.public int recv(byte[] data)
throws IOException
data. The number of bytes actually read is
returned as an integer.recv 在接口中 Connectiondata - an array of byte.IOException - if any.protected void socket()
throws NetworkException
socket.
NetworkException - if any.protected OutputStream out()
out.
OutputStream object.protected InputStream in()
in.
InputStream object.public int getId()
Getter for the field id.
Copyright © 2015. All rights reserved.