Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

newbie - java socket programming

Thread view: 
jackjav - 04 Mar 2007 04:26 GMT
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
Andrew Thompson - 04 Mar 2007 04:30 GMT
> 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.
jackjav - 04 Mar 2007 16:19 GMT
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.

> > need help to get some java code examples for sending fixedformat data
> ..
[quoted text clipped - 11 lines]
>
> Andrew T.
Mark Space - 04 Mar 2007 17:19 GMT
> 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.
Andrew Thompson - 04 Mar 2007 05:27 GMT
..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.
jackjav - 04 Mar 2007 15:18 GMT
sorry. meant to hit reply and clicked reply to author.

> ..me an email.  (Which was, as per usual,
> deleted - unread)
[quoted text clipped - 8 lines]
>
> Andrew T.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.