View Single Post
  #1   Spotlight this post!  
Unread 30-01-2011, 18:10
alexhenning alexhenning is offline
WPILib Developer
FRC #0348
 
Join Date: Apr 2010
Rookie Year: 2003
Location: MA
Posts: 49
alexhenning will become famous soon enough
Receiving UDP packets on the CRIO

Hi,

I've been trying to receive custom data on port 1130, but I am unable to get a connection. When running the following code on the CRIO, it stops after printing "Opening socket connection." I assume the issue is with ss.acceptAndOpen(). It doesn't crash, it just stops at that point.

Quote:
System.out.println("Opening server socket connection.");
ServerSocketConnection ss = (ServerSocketConnection) Connector.open("socket://:1130");
System.out.println(ss.getLocalAddress());
System.out.println("Opening socket connection.");
StreamConnection sock = ss.acceptAndOpen();
System.out.println("Opening input stream.");
in = sock.openInputStream();
Does anybody no what I'm doing wrong? Has anyone been able to successfully read data off of port 1130 in java.

Thanks for any help.

Last edited by alexhenning : 31-01-2011 at 08:47.
Reply With Quote