yatsek / microemu

Automatically exported from code.google.com/p/microemu
0 stars 0 forks source link

datagram:// and socket:// shemes should allow omitting of port number for server mode connections #25

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago

UDPDatagramConnection udpServer = (UDPDatagramConnection) Connector.open
("datagram://:");

This line should create server mode UDPDatagramConnection, bound to system 
assigned port. Instead I get NumberFormatException: For input string: "".

This is due to bug in org.microemu.cldc.datagram.Connection.openConnection
() method, where the {port} part of the url string is supposed to be there 
(and contain valid integer), but in fact it is missing. 

http://code.google.com/p/microemu/source/browse/trunk/microemulator/
microemu-javase/src/main/java/org/microemu/cldc/datagram/
Connection.java#139

This code is the same in v2.0.3, v2.0.4-Snapshot and in trunk of SVN 
repository.

Similar problem exists in org.microemu.cldc.socket.Connection.open(String 
name), when trying to to create socket server with system assigned port 
like this: ServerSocketConnection socketServer = (ServerSocketConnection) 
Connector.open("socket://:");

Original issue reported on code.google.com by damyan.m...@gmail.com on 8 Jan 2010 at 4:36

GoogleCodeExporter commented 9 years ago
Fixed in trunk (future 3.0 version)

Original comment by bar...@gmail.com on 18 Jan 2010 at 9:19