473,385 Members | 1,487 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Sockets in MS' JVM?

Has anyone experienced problems(/solutions) with the use of sockets with
Microsofts JVM. I have to use it to avoid
users having to download the Sun Java plugin. So I'm compiling with:
javac -target 1.1 foo.java
I'm simply trying to connect to the localhost:

socket = new Socket("127.0.0.1", port);

*Nothing* happens..no exceptions!

Kind regards - Jesper
Jul 17 '05 #1
7 1572

"Jesper Matthiesen" <jmatthiesen[_fjen_]@tiscali.dk> wrote in message
news:p1*********************@news000.worldonline.d k...
Has anyone experienced problems(/solutions) with the use of sockets with
Microsofts JVM. I have to use it to avoid
users having to download the Sun Java plugin. So I'm compiling with:
javac -target 1.1 foo.java
I'm simply trying to connect to the localhost:

socket = new Socket("127.0.0.1", port);

*Nothing* happens..no exceptions!

Kind regards - Jesper


I take it you are talking about an applet? Opening a socket connection to
localhost is not allowed from an applet running under normal security mode.
It should give you a security exception in either JRE though.

Silvio Bierman
Jul 17 '05 #2
[...]
I take it you are talking about an applet? Opening a socket connection to
localhost is not allowed from an applet running under normal security mode. It should give you a security exception in either JRE though.

[...]

Yes, sorry. I *am* talking about an applet. I was not aware that it is not
allowed to connect using the loopback address.
However, as you mention I haven't got any security exceptions from either of
the JVM's.
Thanks - Jesper
Jul 17 '05 #3

"Jesper Matthiesen" <jmatthiesen[_fjen_]@tiscali.dk> wrote in message
news:uo*********************@news000.worldonline.d k...
[...]
I take it you are talking about an applet? Opening a socket connection to localhost is not allowed from an applet running under normal security mode.
It should give you a security exception in either JRE though.

[...]

Yes, sorry. I *am* talking about an applet. I was not aware that it is not
allowed to connect using the loopback address.
However, as you mention I haven't got any security exceptions from either

of the JVM's.
Thanks - Jesper


An applet is only allowed to communicate to the server that served the HTML
page it resides on. Have you tried your applet from different workstations?
Are you running it from a browser or are you using an appletviewer?

Silvio Bierman
Jul 17 '05 #4
> An applet is only allowed to communicate to the server that served the
HTML
page it resides on. Have you tried your applet from different workstations? Are you running it from a browser or are you using an appletviewer?


Hi Silvio -
You were right! I was thinking that maybe the loopback could be seen as 'the
same machine' for test purposes even though we are actually making a
connection. However, I tried to catch the security Exception with:

catch(Exception e)
{
txt.append("Error: " + e + "\n");
}

but only

catch(SecurityException e)
{
txt.append("Error: " + e + "\n");
}

actually catches it (using Microsofts JVM). Shouldn't it be caught by the
first try+catch as well??
Thanks - Jesper


Jul 17 '05 #5

"Jesper Matthiesen" <jmatthiesen[_fjen_]@tiscali.dk> wrote in message
news:8y*********************@news000.worldonline.d k...
An applet is only allowed to communicate to the server that served the HTML
page it resides on. Have you tried your applet from different

workstations?
Are you running it from a browser or are you using an appletviewer?


Hi Silvio -
You were right! I was thinking that maybe the loopback could be seen as

'the same machine' for test purposes even though we are actually making a
connection. However, I tried to catch the security Exception with:

catch(Exception e)
{
txt.append("Error: " + e + "\n");
}

but only

catch(SecurityException e)
{
txt.append("Error: " + e + "\n");
}

actually catches it (using Microsofts JVM). Shouldn't it be caught by the
first try+catch as well??
Thanks - Jesper


I would have expected SecurityException to be an Exception. You could try
catching a Throwable since that would always catch any exception thrown.
Exception is a Throwable subclass.

Silvio Bierman
Jul 17 '05 #6
"> I would have expected SecurityException to be an Exception. You could try
catching a Throwable since that would always catch any exception thrown.
Exception is a Throwable subclass.


My point exactly. I haven't tried that yet, but SecurityException is indeed,
as you write, an exception. In Sun JVM v. 1.4.xx the security exception is
not thrown at all.
Regards Jesper

Jul 17 '05 #7

"Jesper Matthiesen" <jmatthiesen[_fjen_]@tiscali.dk> wrote in message
news:3I*********************@news000.worldonline.d k...
"> I would have expected SecurityException to be an Exception. You could try
catching a Throwable since that would always catch any exception thrown.
Exception is a Throwable subclass.


My point exactly. I haven't tried that yet, but SecurityException is

indeed, as you write, an exception. In Sun JVM v. 1.4.xx the security exception is
not thrown at all.
Regards Jesper


Have you in any way tweaked the settings of the Sun JVM to reduce the
security restriuctions?

Silvio Bierman
Jul 17 '05 #8

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tero Saarni | last post by:
Hi, I have several threads communicating with each other using events stored in Queues. Threads block on Queue.get() until somebody publishes an event in thread's event queue. I need to add...
1
by: Dmitry Akselrod | last post by:
Hello everyone, I have a vb.net application that wraps the TCPListener object in a class. The server connects to the local interface and establishes itself on port 9900. It then polls for...
0
by: mrpolitics | last post by:
So I'm working with PureIRCD (http://sourceforge.net/projects/pure-ircd) and everything was fine untill yesterday when the server crashed. So I did a cold restart and staretd the server back up...
3
by: Logan McKinley | last post by:
I have a C# program that uses blocking sockets and want to allow the user to stop the server. The problem I am having is the socket blocks on...
1
by: Adam Clauss | last post by:
I am (attempting) to move an existing socket application to use raw sockets. Right now, my application is essentially a port forwarder. Upon receiving a connection, it will open a connection to...
4
by: BadOmen | last post by:
Hi, What is the different between 'System.Net.Sockets.Socket' and 'System.Net.Sockets.TcpClient'? When do I use System.Net.Sockets.TcpClient and System.Net.Sockets.Socket?? Yours, Jonas
3
by: Michael Maercker | last post by:
hi! i'm really not into networking at all and have now been asigned the task of porting a vb6-code into vb.net (compact framework, in this case) and the code uses the winsock-control. i quickly...
3
by: J C | last post by:
Hi, I'm using UDPClient to make a simple DNS server. I notice that intermittently and unpredictibly I get: Unhandled Exception: System.Net.Sockets.SocketException: An existing connection...
7
by: Adam01 | last post by:
Im using cygwin to test the code of a server I am writing. I've included sys/types.h, sys/socket.h, netdb.h, and arpa/inet.h. And this is the output.. ../../../sockets.cpp: In constructor...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.