Code examples for DatagramPacket

Codota analyzed 7,668,838 open source code samples to find the most common, credible and clear examples.
You can now enable Codota on your own code to easily search and navigate your Java codebase.
79:	DatagramPacket dataPack = new DatagramPacket(buf, buf.length); 
-
82:	RtpPacket inPacket = new RtpPacket(dataPack.getData(), dataPack.getLength()); 
Full Snippet Info
8
CodeRank
35:	DatagramPacket p = new DatagramPacket(b1, 512, 512 ); 
-
38:	p.setData(b2); 
-
40:	if (p.getOffset() != 0) { 
Full Snippet Info
7
CodeRank
394:	netImpl.recvConnectedDatagram(fd, pack, pack.getData(), pack.getOffset(), pack 
395:	.getLength(), receiveTimeout, true); // peek 
-
399:	netImpl.receiveDatagram(fd, pack, pack.getData(), pack.getOffset(), pack 
400:	.getLength(), receiveTimeout, true); // peek 
-
405:	return pack.getPort(); 
-
418:	packet.setAddress(connectedAddress); 
419:	packet.setPort(connectedPort); 
Full Snippet Info
7
CodeRank
153:	byte[] src = packet.getData(); 
154:	byte[] dst = new byte[packet.getLength()]; 
-
156:	packet.setData(dst); 
Full Snippet Info
7
CodeRank
138:	DatagramPacket packet = new DatagramPacket(new byte[MESSAGE_LENGTH], MESSAGE_LENGTH); 
-
144:	ByteQueue queue = new ByteQueue(packet.getData(), 0, packet.getLength()); 
Full Snippet Info
7
CodeRank
269:	netImpl.sendConnectedDatagram(fd, packet.getData(), packet.getOffset(), packet 
270:	.getLength(), bindToDevice); 
-
273:	netImpl.sendDatagram(fd, packet.getData(), packet.getOffset(), packet.getLength(), 
274:	packet.getPort(), bindToDevice, trafficClass, packet.getAddress()); 
Full Snippet Info
6
CodeRank
213:	packet = new DatagramPacket (dst.array(), 
-
228:	socket.receive (packet); 
-
239:	dst.put (packet.getData(), packet.getOffset(), packet.getLength()); 
-
243:	dst.position (dst.position() + packet.getLength()); 
-
246:	return packet.getSocketAddress(); 
Full Snippet Info
6
CodeRank
122:	nativeSendTo(socket, packet.getAddress(), packet.getPort(), 
123:	packet.getData(), packet.getOffset(), packet.getLength()); 
Full Snippet Info
6
CodeRank
39:	byte [] data = packet.getData(); 
40:	String received = new String(data, 0, packet.getLength()); 
-
45:	packet.getAddress(), packet.getPort())); 
Full Snippet Info
6
CodeRank
23:	} 
-
29:	protected void tearDown() throws Exception { 
30:	super.tearDown(); 
Full Snippet Info
6
CodeRank
59:	DatagramPacket dp = new DatagramPacket(new byte[0], 0); 
60:	dp.setData(mssg.getBytes("UTF8")); 
61:	dp.setLength(dp.getData().length); 
62:	dp.setAddress(addr.getIaddr()); 
63:	dp.setPort(addr.getPort()); 
-
67:	.decode(ByteBuffer.wrap(dp.getData()))); 
Full Snippet Info
6
CodeRank
25:	DatagramPacket p = new DatagramPacket(buf, buf.length); 
-
27:	addServer(p.getAddress(), p.getPort()); 
28:	p.setData(new byte[] {0}); 
Full Snippet Info
6
CodeRank
48:	DatagramPacket packet = new DatagramPacket(buf, off, len); 
-
50:	return packet.getLength(); 
Full Snippet Info
6
CodeRank