[3689] in java-interest

home help back first fref pref prev next nref lref last post

Re: Socket Problem (new)

daemon@ATHENA.MIT.EDU (Gary Aitken)
Wed Nov 22 09:43:16 1995

Date: Mon, 20 Nov 1995 00:54:06 -0700
From: garya@village.org (Gary Aitken)
To: "Ka-Fai Lau(MS)" <klau01@widelux.poly.edu>,
        java-interest-digest@java.sun.com
In-Reply-To: <Pine.SUN.3.91.951113155552.6076D-100000@widelux.poly.edu>

>When I use the method getLocalPort from the SocketServer Class, I always 
>get an compiling error saying that the method not found in class such as 
>such.  The JDK I am using is 1.0 beta.  
>
>For example, 
>	
>	ServerSocket Sock = new ServerSocket(0,100);
>	
>	Sock.getLocalPort();

It seems strange that the new ServerSocket would compile, but not
the reference to the method getLocalPort.  The following compiles fine
for me:

import java.net.*;

public class SocketTest {
	public static void main( String argv[] ) {
		try {
			ServerSocket Sock = new ServerSocket(0,100);
			Sock.getLocalPort();
		}
		catch (java.io.IOException ex) {
		}
	};
}

Gary Aitken		garya@village.org
-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post