newbie - java socket programming

J

jackjav

need help to get some java code examples for sending fixedformat data
from

client -----> socketserver --------> server2 ( no socket ) and then

server2------>socketserver-------->client

and the data once sent by the client should process by server2 and
received by the client. any help please

jack
 
A

Andrew Thompson

need help to get some java code examples for sending fixedformat data ...
and the data once sent by the client should process by server2 and
received by the client. any help please

Trying my 'standard search' on such things..
<http://www.google.com/search?q=java+tutorial+server+client>
Suggests the second top link at the moment
(or the top link) are good places to start.
From memory, a complete code example is
included.

HTH

Andrew T.
 
A

Andrew Thompson

...me an email. (Which was, as per usual,
deleted - unread)

Please note the 'quote'.
<http://groups.google.com/groups/profile?
enc_user=7mTjyhYAAADCSWBnolz9mAH1YeBMyEJTo4cocwWvDVg2RHsu8f1bCg>

If you have something to say about
this thread, worth hearing, please
put it on the (public) thread.

Andrew T.
 
J

jackjav

Thanks for your help, sure that's a good way to start to learn on
sockets.

Although I am not an expert, I did do some search for the
multithreaded socket programming gathered some knowledge, but was
wondering if I could get some help gather information on how to come
up with some psuedo-code/examples for the process I am trying to
implement.

As one would gather from my initial post, the idea is to have a client
send fixedformat message to a socketserver(this part is okay), and the
socketserver to send the "same message" in the same or xml format to
the secondserver( this is where I am trying to get some help).

The second server processes the input data, and returns response to
the socketserver, which inturn will send it to the client. The caveat
as you see is that for the secondserver I cannot use sockets, my
options are http/https/webservices.

And the client waits for the response on the request made.

Here is an example of a fixed format data.

client sends this message

sdfjdoso9refsdfdsf sdfdgtgop dsfdsfdsf sdfdsf dsfdsf
dsfytuytbvqwghh gjyuertew jkmyukthg
324fdgfh76hj 76867
EOFEOFEOF

after the socketserver sends it to and processed by the secondserver
the client receives this message

trhthdfgdsfew4r hghjhgjh gfhjgh ghjhgjer sdfdsf
dfhg78kasw32545687980hgjdsfdg6576577687
EOFEOFEOF


Thanks for any help.
Jack.
 
M

Mark Space

jackjav said:
Thanks for your help, sure that's a good way to start to learn on
sockets.

Although I am not an expert, I did do some search for the
multithreaded socket programming gathered some knowledge, but was

I'm not really an expert either, but I'm trying to learn more about Java
network programming so your question was interesting to me.

My first question back is "What is fixedformat?" Is that some Java term
I'm not familiar with or some other API? Other than the obvious (just a
descriptive term), I didn't recognize it.
The second server processes the input data, and returns response to
the socketserver, which inturn will send it to the client. The caveat
as you see is that for the secondserver I cannot use sockets, my
options are http/https/webservices.

An HTTP connection IS a socket. There's plenty of examples of speaking
HTTP over a Java socket on the web. If you can't find any to your
liking, I think the example HTTP server in O'Reilly's _Learning Java_ is
a pretty good example.
And the client waits for the response on the request made.

You have three servers here, not two. Any system that waits for
incoming requests is a server, and you'll need to make sure all
firewalls, proxies, etc. in front of this "client" can accept an
incoming request from a foreign system.

If not, you may have to leave the original connection open from the
client, and have the first sever relay the message for server2.
 

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

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,565
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top