Re: problem with applet ....
From: Andrew Skouloudis (afterskoulNOSPAMPLEASE_at_yahoo.com)
Date: 12/31/03
- Previous message: ak: "Re: JSplitPane Problem"
- In reply to: Danny Woods: "Re: problem with applet ...."
- Next in thread: Danny Woods: "Re: problem with applet ...."
- Reply: Danny Woods: "Re: problem with applet ...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 31 Dec 2003 16:05:43 +0200
On 31 Dec 2003 09:23:35 +0000, Danny Woods
<no-mail-here@black.hole.com> wrote:
>Andrew Skouloudis <afterskoulNOSPAMPLEASE@yahoo.com> writes:
>
>> I am trying to create a simple applet for two playes (MineSweeper )
>> using a server-client scheme . The problem is that I cannot make both
>> the server and the client to create a new game (in the final version
>> of the pogram the client and the server play on the same board but
>> that is not the problem now ).
>>
>> Using the following code i can make the client start a game but not
>> the server :
>>
>> localhostSocket = new Socket("127.0.0.1", 9999);
>
>I'm dubious about this. Applets can only connect to the IP they were
>served from, and can't even connect to localhost. If it were allowed,
>two applets from unrelated servers could exchange information via
>sockets by using the loopback address. That would be a security breach
>waiting to happen.
>
>Generally, expect SEVERE restrictions on networking in applets. Peer-to-peer
>is simply not possible without digital signatures, which means that you'd
>have to have some server side processing to allow a game at all. Each applet
>could connect to the serving box and receive notification of events from
>a CGI script or custom-written server app.
>
>As a tip, when you catch exceptions, print it out to the console during
>development. As Andrew Thompson says, you'll most likely find that it's a
>security exception.
>
>Regards,
>
>Danny.
Well i don't know if it is my lucky day but i managed finally to make
them communicate using the loopback 127.0.0.1 , Now the server can
send the board to the client . But i have a question here . I want
first the server to play and then to send the move to the client .
Once the client has received the data and have the board repainted,
he can play his move but not before that .The client cannot click on
the board unless he sees the move of his opponent in his board . How
can I do that ?? . How can I make the click event to have no effect on
the board before receiving the data from the server ????
- Previous message: ak: "Re: JSplitPane Problem"
- In reply to: Danny Woods: "Re: problem with applet ...."
- Next in thread: Danny Woods: "Re: problem with applet ...."
- Reply: Danny Woods: "Re: problem with applet ...."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|