For Programmers: Free Programming Magazines  


Home > Archive > Java Help > May 2006 > blocked call using UDP









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author blocked call using UDP
sarath

2006-05-25, 7:06 pm

Hi everyone..

I have a situation


i am using a web application and i have to talk to a different
server through UDP.
The problem that i find is, i want that communication to be
request/response,
Like the one used by JDBC. ie, when i send a request, i need the
reply in that line
of the code itself as if it is a function call.

for instance,the execute method of the statement object fetches the
data from the server, makes
it in the format specified by JDBC and gets the control back to the
same line. anyone has any
idea how that is done ? any help would be appreciated...


Thanks in advance

regards

sarath

Gordon Beaton

2006-05-25, 7:06 pm

On 25 May 2006 05:03:10 -0700, sarath wrote:
> i am using a web application and i have to talk to a different
> server through UDP. The problem that i find is, i want that
> communication to be request/response, Like the one used by JDBC. ie,
> when i send a request, i need the reply in that line of the code
> itself as if it is a function call.
>
> for instance,the execute method of the statement object fetches the
> data from the server, makes it in the format specified by JDBC and
> gets the control back to the same line. anyone has any idea how that
> is done ? any help would be appreciated...


Write a method that fills a datagram with the request data, sends it
to the remote, waits for the reply datagram, extracts the reply data,
and finally returns a value to the caller.

Your application will make a single call to your method, and it
appears to occur "all on the same line".

/gordon

--
[ do not email me copies of your followups ]
g o r d o n + n e w s @ b a l d e r 1 3 . s e
Oliver Wong

2006-05-26, 7:07 pm


"Gordon Beaton" <n.o.t@for.email> wrote in message
news:4475a62d$1@news.wineasy.se...
> On 25 May 2006 05:03:10 -0700, sarath wrote:
>
> Write a method that fills a datagram with the request data, sends it
> to the remote, waits for the reply datagram, extracts the reply data,
> and finally returns a value to the caller.
>
> Your application will make a single call to your method, and it
> appears to occur "all on the same line".


This method that you'll write should probably be declared as throwing an
exception or two, in case you time out while waiting, or the your Internet
connection fails, or various other problems crop up.

- Oliver

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com