About Question enthuware.ocejws.v6.2.205 :

All the posts and topics that contain only an error report will be moved here after the error is corrected. This is to ensure that when users view a question in ETS Viewer, the "Discuss" button will not indicate the presence of a discussion that adds no value to the question.

Moderators: Site Manager, fjwalraven

Post Reply
himaiMinh
Posts: 358
Joined: Fri Nov 29, 2013 8:26 pm
Contact:

About Question enthuware.ocejws.v6.2.205 :

Post by himaiMinh »

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.

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.205 :

Post by fjwalraven »

To clean up the resources nicely, yes.

mameko
Posts: 4
Joined: Mon May 04, 2015 11:02 am
Contact:

Re: About Question enthuware.ocejws.v6.2.205 :

Post by mameko »

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,

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.205 :

Post by fjwalraven »

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:
In general, creating a connection to a URL is a multistep process
All examples I have seen so far (and all my code snippets) can do without the explicit call to the connect method.

Regards,
Frits

ramy6_1
Posts: 124
Joined: Wed Feb 12, 2014 2:44 am
Contact:

Re: About Question enthuware.ocejws.v6.2.205 :

Post by ramy6_1 »

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.

fjwalraven
Posts: 429
Joined: Tue Jul 24, 2012 2:43 am
Contact:

Re: About Question enthuware.ocejws.v6.2.205 :

Post by fjwalraven »

Hi,

I agree it can make you confused. I will change this option.

Thanks for your feedback!

Regards,
Frits

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests