151 |
throws IOException |
throws IOException |
152 |
{ |
{ |
153 |
this(); |
this(); |
154 |
|
|
155 |
if (impl == null) |
if (impl == null) |
156 |
throw new IOException("Cannot initialize Socket implementation"); |
throw new IOException("Cannot initialize Socket implementation"); |
157 |
|
|
182 |
public void bind (SocketAddress endpoint) |
public void bind (SocketAddress endpoint) |
183 |
throws IOException |
throws IOException |
184 |
{ |
{ |
185 |
if (impl == null) |
bind (endpoint, 50); |
|
throw new IOException ("Cannot initialize Socket implementation"); |
|
|
|
|
|
if (! (endpoint instanceof InetSocketAddress)) |
|
|
throw new IllegalArgumentException ("Address type not supported"); |
|
|
|
|
|
InetSocketAddress tmp = (InetSocketAddress) endpoint; |
|
|
|
|
|
SecurityManager s = System.getSecurityManager (); |
|
|
if (s != null) |
|
|
s.checkListen (tmp.getPort ()); |
|
|
|
|
|
impl.bind (tmp.getAddress (), tmp.getPort ()); |
|
186 |
} |
} |
187 |
|
|
188 |
/** |
/** |