Question about http pipelining

P

panatha

I am trying to implement a consumer-producer scenario communicating
via HTTP pipelining.
Can anyone talk me through some questions that i have regarding my
problem?

I have the consumer side the socketsend class that when a message-
request is ready it sends it through the socket ,that the the
socketserver class that manages the sockets, starts.
Now i have the HttpServer and the HTTPSend classes as well. The first
class manages the opening and closing of the connection and the second
class sends or receives.

Now my questions are:
1) do i have to produce multiple messages at the same time and just
call the outputstream for example to send them? or do i have to do
something else?
2) i am not sure if i understood correctly the classes that java.sun
provide us cause i think that the socket classes will implement the
http pipelining and not the http classes.
3) would it be a solution to open multiple sockets at the same time
and send and receive via those or i will have a problem opening many
sockets with the same port cause the port is predefined by the
consumer and the producer in order to communicate and exchange
messages, so it can not be changed.

Please if there is anyone that has previous experience with such
problems please help me.
thank you in advance
 
G

GArlington

I am trying to implement a consumer-producer scenario communicating
via HTTP pipelining.
Can anyone talk me through some questions that i have regarding my
problem?

I have the consumer side the socketsend class that when a message-
request is ready it sends it through the socket ,that the the
socketserver class that manages the sockets, starts.
Now i have the HttpServer and the HTTPSend classes as well. The first
class manages the opening and closing of the connection and the second
class sends or receives.

Now my questions are:
1) do i have to produce multiple messages at the same time and just
call the outputstream for example to send them? or do i have to do
something else?
2) i am not sure if i understood correctly the classes that java.sun
provide us cause i think that the socket classes will implement the
http pipelining and not the http classes.
3) would it be a solution to open multiple sockets at the same time
and send and receive via those or i will have a problem opening many
sockets with the same port cause the port is predefined by the
consumer and the producer in order to communicate and exchange
messages, so it can not be changed.

Please if there is anyone that has previous experience with such
problems please help me.
thank you in advance

You have a server that runs on predefined port (this is a must -
otherwise you have no way of starting the conversation). When your
server receives first request (see handshake) it should open NEW
connection over some available port (this is not the same predefined
port you send you initial request to). If you try to look at tcp-ip
conversation between your browser and any web server you can see what
happens. Then any further message exchange happens over this new pair
(one on server, one on client) of ports until you close your
connection. You can find a lot more info and examples if you search
google for 'java socket programming'.
 
S

stavrinio

You have a server that runs on predefined port (this is a must -
otherwise you have no way of starting the conversation). When your
server receives first request (see handshake) it should open NEW
connection over some available port (this is not the same predefined
port you send you initial request to). If you try to look at tcp-ip
conversation between your browser and any web server you can see what
happens. Then any further message exchange happens over this new pair
(one on server, one on client) of ports until you close your
connection. You can find a lot more info and examples if you search
google for 'java socket programming'.


Question to all that you said how can I succesfully implement
pipelining from what you wrote before I am not sure if
it will work at all if i try to open many sockets and send single
message from different socket that is not pipelining at
least of what i know:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top