Re: Limit Single Instance (update: test)



"jcsnippets.atspace.com" <admin@xxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:Y89Ef.228150$A5.7376939@xxxxxxxxxxxxxxxxxxxxxxxx
> I'll run a simple test later on this evening, and post my findings here.

Hi,

I just ran the following pieces of code on my machine (warning: quick &
dirty code ahead) and in both cases, ZoneAlarm complained about the program
asking for rights to act as a server or to connect.

-- 1) ServerSocket
import java.net.ServerSocket;

public class TestServerSocket
{

 public TestServerSocket()
 {
  try
  {
   ServerSocket s = new ServerSocket(5555);
   s.accept();
  }
  catch (Exception e)
  {}
 }

 public static void main(String[] args)
 {
  new TestServerSocket();
 }

}

-- 2) Socket
import java.net.Socket;

public class TestSocket
{

 public TestSocket()
 {
  try
  {
   Socket s = new Socket("localhost", 21);
  }
  catch (Exception e)
  {}
 }

 public static void main(String[] args)
 {
  new TestServerSocket();
 }

}
-- end code

Personally, I expect other firewall to display the same behaviour. If not
for the Socket example, then at least for the ServerSocket, since you're
setting up a server of some sorts.

Regards,

JC
--
http://jcsnippets.atspace.com
a collection of source code, tips and tricks


.



Relevant Pages

  • Re: Limit Single Instance (update: test)
    ... > public class TestServerSocket ... > ServerSocket s = new ServerSocket; ... > public class TestSocket ... > Socket s = new Socket ...
    (comp.lang.java.help)
  • Re: Question with regard to Sockets
    ... > a) Socket is used by the client to initiate ... > listen for incoming connections and using a ServerSocket ... Socket is an end of a connection. ... I know nothing about NTP proxies. ...
    (comp.lang.java.programmer)
  • Re: Question with regard to Sockets
    ... Atirya Yodha wrote: ... > a) Socket is used by the client to initiate ... > listen for incoming connections and using a ServerSocket ... > then how can I make connections to certain web servers (an NTP ...
    (comp.lang.java.programmer)
  • Socket (and Selector) seems to freeze after first data stream
    ... ServerSocketChannel with a Selector for OP_ACCEPT. ... I have a Perl program I'm using to send data to the ServerSocket. ... It does see the first message sent to the socket and receives it properly. ...
    (comp.lang.java.help)
  • Socket communication problem
    ... information it sends an acknowledgement message to the sender. ... public class KKMultiServer { ... ServerSocket serverSocket = null; ... private Socket socket = null; ...
    (comp.lang.java.help)