For the sake of discussion, I initially thought connection.connect() is considered as a set up method.
Because I thought without connect(), the client won't receive any input.
But I found an example from a book, which doesn't even need this method.
The openConnection() will connect to the service.
However, I think disconnect() is necessary as the end of the client's application.
About Question enthuware.ocejws.v6.2.205 :
Moderators: Site Manager, fjwalraven
-
- Posts: 358
- Joined: Fri Nov 29, 2013 8:26 pm
- Contact:
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.205 :
To clean up the resources nicely, yes.
-
- Posts: 4
- Joined: Mon May 04, 2015 11:02 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.205 :
Hi,
I saw this in API:
It should be noted that a URLConnection instance does not establish the actual network connection on creation. This will happen only when calling URLConnection.connect().
So do we need the connect() method or not ?
Thanks,
I saw this in API:
It should be noted that a URLConnection instance does not establish the actual network connection on creation. This will happen only when calling URLConnection.connect().
So do we need the connect() method or not ?
Thanks,
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.205 :
Hi
Yes, you are right this is written in the API. However you can also deduct from the following phrase that it is not always necessary:
Regards,
Frits
Yes, you are right this is written in the API. However you can also deduct from the following phrase that it is not always necessary:
All examples I have seen so far (and all my code snippets) can do without the explicit call to the connect method.In general, creating a connection to a URL is a multistep process
Regards,
Frits
-
- Posts: 124
- Joined: Wed Feb 12, 2014 2:44 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.205 :
Hello ,
I believe the answers will be clearer if you removed connection.connect(); from the available options.
It is confusing beside "This is not a setup method."
For me it can be correct answer in the subject context.
I believe the answers will be clearer if you removed connection.connect(); from the available options.
It is confusing beside "This is not a setup method."
For me it can be correct answer in the subject context.
-
- Posts: 429
- Joined: Tue Jul 24, 2012 2:43 am
- Contact:
Re: About Question enthuware.ocejws.v6.2.205 :
Hi,
I agree it can make you confused. I will change this option.
Thanks for your feedback!
Regards,
Frits
I agree it can make you confused. I will change this option.
Thanks for your feedback!
Regards,
Frits
Who is online
Users browsing this forum: No registered users and 3 guests