Hi,

But before send request, we have do the things below.

        FuturePromise<Session> sessionPromise = new FuturePromise<>();

        client.connect(sslContextFactory, new InetSocketAddress(host, port),
new ServerSessionListener.Adapter(), sessionPromise);

        Session session = sessionPromise.get(5, TimeUnit.SECONDS);

        HttpFields requestFields = new HttpFields();

        requestFields.put("User-Agent", client.getClass().getName() + "/" +
Jetty.VERSION);

        MetaData.Request metaData = new MetaData.Request("GET", new HttpURI(
"https://"+host+":"+port+"/";), HttpVersion.HTTP_2, requestFields);

        HeadersFrame headersFrame = new HeadersFrame(0, metaData, null, true
);


    then we can make the request:

     session.new stream(.....)


If I have a array contains 10000sites. for example websites[10000];

Which things should be done 10000 times?

I have tried to start client once only. but I still failed.

2015-09-21 14:50 GMT+08:00 Simone Bordet <[email protected]>:

> Hi,
>
> On Sun, Sep 20, 2015 at 7:42 PM, Muhui Jiang <[email protected]> wrote:
> > I tried to use jetty client to scan many website.
> >
> > But it seems every time I let the client start and it will creates a new
> > thread
>
> You have to start HttpClient once only.
>
> Once that only instance is started, you can use it to scan as many
> sites you want.
>
> --
> Simone Bordet
> ----
> http://cometd.org
> http://webtide.com
> Developer advice, training, services and support
> from the Jetty & CometD experts.
> _______________________________________________
> jetty-users mailing list
> [email protected]
> To change your delivery options, retrieve your password, or unsubscribe
> from this list, visit
> https://dev.eclipse.org/mailman/listinfo/jetty-users
>
_______________________________________________
jetty-users mailing list
[email protected]
To change your delivery options, retrieve your password, or unsubscribe from 
this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-users

Reply via email to