Code example for DatagramSocket

Methods: getSoTimeout

0
		return socket.getLocalPort();
	} 
 
	/** Gets the socket timeout. */ 
	public int getSoTimeout() throws java.net.SocketException { 
		return socket.getSoTimeout();
	} 
 
	/** 
	 * Enables/disables socket timeout with the specified timeout, in 
	 * milliseconds. 
	 */ 
	public void setSoTimeout(int timeout) throws java.net.SocketException {
		socket.setSoTimeout(timeout);
	} 
 
	/** Receives a datagram packet from this socket. */ 
	public void receive(UdpPacket pkt) throws java.io.IOException {
		DatagramPacket dgram = pkt.getDatagramPacket();
		socket.receive(dgram);
		pkt.setDatagramPacket(dgram);