Share via


DatagramSocketImpl.PeekData(DatagramPacket) Method

Definition

Peek at the packet to see who it is from.

[Android.Runtime.Register("peekData", "(Ljava/net/DatagramPacket;)I", "GetPeekData_Ljava_net_DatagramPacket_Handler")]
protected abstract int PeekData (Java.Net.DatagramPacket? p);
[<Android.Runtime.Register("peekData", "(Ljava/net/DatagramPacket;)I", "GetPeekData_Ljava_net_DatagramPacket_Handler")>]
abstract member PeekData : Java.Net.DatagramPacket -> int

Parameters

p
DatagramPacket

the Packet Received.

Returns

the port number which the packet came from.

Attributes

Exceptions

if an error occurs while peeking at the data.

Remarks

Peek at the packet to see who it is from. The data is copied into the specified DatagramPacket. The data is returned, but not consumed, so that a subsequent peekData/receive operation will see the same data.

Added in 1.4.

Java documentation for java.net.DatagramSocketImpl.peekData(java.net.DatagramPacket).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to