One ServerSocket on specific port on LAN

Hi all,
How can I prevent multiple instances of a server (implemented using a ServerSocket listening on certain port) are being started on my LAN.
Only one instance (server) may be running on my network.
Thanks for helping me out.
Kind regards,

Hi all,
How can I prevent multiple instances of a server
(implemented using a ServerSocket listening on certain
port) are being started on my LAN.Huh?
Do you mean on a single computer (not lan.) More than one isn't possible. There can only be one TCP listener on a port.
>
Only one instance (server) may be running on my
network.On a network is a different problem. I am not sure why you would even care. A TCP connection requires a destination address. Even if other computers were running the clients wouldn't care because they must go to a single destination.
But if you want you need to designate another port using UDP. Your app on start up would broadcast a message on that port. If another server is already up then it responds. If your app receives a response then it knows something else is running so it can shut down. You need probably need to deal with the lag time, by using a timeout and several messages.

Similar Messages

  • WRT54G: How do I limit access to specific ports, only to local IP's

    Using a WRT54G with Windows XP, and I've setup a web server that I'm still testing. Until I understand the security better, I want to limit access from outside IP's to the port that it's running on, but NOT limit access from the outside to services running on other ports. Is there a way to block a range of IP addresses (or conversely, only permit access for a limited range of IP addresses) to a specific port? So for example (assuming server's on Port 99, and IP address to the outside world is 99.99.99.99: Port 99: Blocked IP Range: 0.0.0.0-99.99.99.98, and 99.99.99.100-255.255.255.255 - OR Port 99: Allowed IP Range: 99.99.99.99 Alternatively, I would be interested to permit access to the web server port, only for certain MAC addresses. Is this pretty secure, and if so, how can this be done? I've poked around the router settings and spent a good deal of time researching this; any help would be greatly appreciated...

    Why do you want to block IP addresses:  "IP Range: 0.0.0.0-99.99.99.98, and 99.99.99.100-255.255.255.255" ?   This is everybody on the web, except your router!    If you really want to block all these people, just unplug your router from your Internet connection.  That is a block that cannot be hacked!
    Normally a server is assigned a fixed LAN IP address.  This address must be outside the DHCP server range of your router, and it cannot end in 0, 1, or 255.
    Next you forward a port (for example, 99) to the server's fixed LAN IP address.
    Data arriving at the Internet port of your WRT54G for port 99 will then be forwarded to your server.  If you have other Internet services (i.e. server B) running on port 1297, then data that arrives at the Internet port of your WRT54G for port 1297 will be directed to server B.   Assuming that you only have port 99 and port 1297 open, then any other unrequested data (for any other port) that arrives at the Internet port of your WRT54G will simply be ignored (and thereby blocked).    If you connect another computer to a LAN port of the WRT54G, connect to the Internet, and request data, then when that data arrives at the Internet port of the WRT54G, it will be allowed to pass, and it will be routed to your computer.
    In summary, by default, all router ports are closed.  The only way to get data through the router is either to open a port (using port forwarding, or alternatively, the UPnP function), or for someone (or some program) on the LAN to request data from the web.
    The router cannot limit the use of a port by MAC address.    When you open a port on your router, you are opening your server to invasion from anyone on the Internet.  So, your server must be setup to protect itself.   Rather than limiting server use by MAC address (which can be faked), your server should be setup to require a user name and password. 

  • Network ACL for two specific ports

    As far as I can tell there is no way to set Network ACLs such that only two specific ports are available. I'm using Oracle 11gR2.
    I'd like a HTTP port and an SMTP port open for the local loopback address. These are ports 7777 and 25. It's my understanding that you can have only one ACL per host. While it seems you can create more, any additional ACL's for the same host don't always work as expected. So does anyone have any advice as how I can do this? I'd rather not have every port between 7777 and 25 available but this is what I currently have...
    DBMS_NETWORK_ACL_ADMIN.ASSIGN_ACL(
    acl => 'local_loopback.xml'
    , host => '127.0.0.1'
    , lower_port => 25
    , upper_port => 7777
    );

    Billy  Verreynne  wrote:
    As far as I can tell there is no way to set Network ACLs such that only two specific ports are available. I'm using Oracle 11gR2.>Not so in my experience. An ACL can be for a specific target, but contain multiple ports for that target.
    E.g. I assign ports 80, 7777, 8080, and a few others, in a single web-acl.xml, to a network target (host or domain).
    Read the usage notes in Oracle® Database PL/SQL Packages and Types Reference.>Thanks I'll try that. I think we had problems in the past with separate ACL's containing rules for the same host, the response we got back from support was not to do that. This way didn't occur to me.

  • WRT610N V2 blocks traffic on specific port after large transfer

    Goodday,
    It came to my attention that when i transfer a large amount of files to the USB storage device, which can be attached to the router, it closes the port and can't be reopened anymore.
    To solve this problem a power cycle/reboot is needed. 
    I also had a WRT610 V1 that didnt have this problem.
    It looks a bit like there is a counter which counts the amount of data transfered thru a socket (on a specific port) and if that exceeds a certain amount it will block that port.
    I'm wondering if more people are experiencing this.
    By the way: this is the second device the retailer gave me. First one had the exact same issue. This also happend to port 80 (internet) as well.
    Thanks in advance.
    Kind regards,
    Xionax Lomax
    Message Edited by Xionax on 01-19-2010 10:40 AM

    Have you tried with different computer..?
    Try with the different computer and check..
    Try to reduce the Card speed of NIC on the computer to 10 Mbps half duplex and check if that make any difference.

  • Open IP to on specific port

    Hi!
    I have one internal IP and two external IP adresses. I want to use one adress for allowing mail to my server and one address for sending mails to mobile phones.
    I am not sure about how the NAT should look like. The ACL is no problem since I have two public adresses.
    How do i NAT specific ports for specific adresses? 
    10.1.1.2 should be NATted to 15.15.15.15 port 34
    10.1.1.2 should be NATted to 15.15.15.16 port 443
    /Lajja

    Hello,
    If you are running version 8.3 or above, you can apply the following commands:
    object network obj-10.1.1.2.34
    host 10.1.1.2
    nat (Inside,Outside) static 15.15.15.15 service tcp 34 34 nds:
    object network  obj.10.1.1.2.443
    host 10.1.1.2
    nat (Inside,Outside) static 15.15.15.16 service tcp 443 443
    If you are running version 8.2 or less, you will need to apply the following commands:
    static (Inside,Outside) tcp 15.15.15.15 34 10.1.1.2 34
    static (Inside,Outside) tcp 15.15.15.16 443 10.1.1.2 443
    Let me know how it goes.

  • Ftp_connect with specific port

    Hi All,
    Any help using FTP_CONNECT function, Doing connection to ftp server with specifi port (not port 21) will be greatly appreciated. Any one?
    thanks
    supriatna

    Hi Supriatna,
    sample code may be useful to you:
    FTP Connect
      CALL FUNCTION 'FTP_CONNECT'
        EXPORTING
          USER                   = P_USER
          PASSWORD               = P_PWD
          ACCOUNT                =
          HOST                   = P_HOST
          RFC_DESTINATION        = 'SAPFTPA'
          GATEWAY_USER           =
          GATEWAY_PASSWORD       =
          GATEWAY_HOST           =
        IMPORTING
          HANDLE                 = HDL
        EXCEPTIONS
          NOT_CONNECTED          = 1
          OTHERS                 = 2.
    If sy-subrc = 0.
            CALL FUNCTION 'FTP_COMMAND'
                 EXPORTING
                      HANDLE        = HDL
                      COMMAND       = V_PATH
                 TABLES
                      DATA          = IT_RESULT
                 EXCEPTIONS
                      TCPIP_ERROR   = 1
                      COMMAND_ERROR = 2
                      DATA_ERROR    = 3
                      OTHERS        = 4.
    Endif.
    Lanka

  • How to force dg4msql to use a specific port

    I've configured an Oracle Database Gateway (Linux RHEL 5) to connect to my SQL Server boxes, but have a host based firewall (on the Linux box) in between them. Sniffing shows that the communication to port 1433 comes from a range of port numbers on the Linux box. Is there a way to force 'dg4msql' to only use a specific port?
    Removing the host based firewall is not an option, nor is opening up total communication between the two machines. Hopefully 'dg4msql' can be configured to use a specific port.

    Hi,
    It isn't possible to configure the gateway to onlyuse specific ports.
    This is not just a gateway issue but the way that SQL*Net works and you should see the same problem connecting from one Oracle database to another through a firewall.
    The only workround is to use a firewall which is SQL*Net compliant or a firewall which will limit the number of ports to a certain application.
    You could also review this note -
    Oracle and Firewalls: Answers to Frequently Asked Questions (Doc ID 2084440.6)
    Regards,
    Mike
    Edited by: mkirtley on Mar 2, 2010 8:45 AM

  • SG300 - ip address restricted to specific port??

    I have just set up an SG300 with protected ports so that different ports can not see the traffic on other ports. Now I am being asked to restrict specific ports to using only specific ip addresses. Is this possible with this switch?
    Each port will need to allow several (5-6) addresses.
    Thanks,
    TonyT

    ACL might work. Here are more details:
    We provide off-site mirrored storage for about a dozen customers. Each one provides their own firewall and vpn equiptment. Each customer has use of one protected port on the SG300 connected to their equiptment.
    We have a class-C IP range and we tell each customer what ip addresses they can use. For example, Joe can use .8-.15, Bob can use .16-.23, etc.
    We want to protect Joe should Bob fat-finger an address and ends up using .9 (intending .19)  while Joe is already using .9. We want only Bob to get errors and not Joe.
    Can it be done on a SG300?
    Tx,
    TonyT

  • Cisco WLC2125 Reporting Traps to a specific port

    Hi all,
    I am currently looking into reporting options for my Cisco WLC2125. From what I can see, I have two options, SNMP or Syslog however I would like to assign either Syslog or SNMP traffic via a specific port on the controller.
    The reason is because i want to keep this traffic seperate to my wireless network.
    My knowledge of controllers (and syslog and SNMP for that matter) but I can enter IP addresses for the servers however i cannot see how to assign this traffic to a specific port.
    Is this possible? If so how?
    Many Thanks,
    -c

    No, its not possible with a 2100.  Best practices say you should only have one connection from a 2100 controller to the network, so all traffic to the network would go out that port.
    https://supportforums.cisco.com/docs/DOC-11760

  • How to open specific port using java program

    Hello,
    I want to open ,close port using java comm.plz help me how can i do it.is it possible
    by using java program.later i want to use that specific port to accept the server socket connection .plz
    help me.

    i try this java program.*but it get block in accept method*.tht mean i m not able to make connection with port.
    import java.sql.SQLException;
    import java.io.IOException;
    import java.net.ServerSocket;
    import java.util.logging.Level;
    import java.util.logging.Logger;
    class MakeConn
         public final static int PORT = 7788;
    public static java.net.Socket clientSocket = null;
    public static java.io.PrintWriter pw = null; // socket output stream
    public static java.io.BufferedReader br = null;
    public static ServerSocket server_socket;
         public static void main(String[] args) throws SQLException
         try {
              server_socket = new ServerSocket(PORT);
    clientSocket = server_socket.accept();
    System.out.println("CLIENT>>>" + clientSocket);
         br = new java.io.BufferedReader(new java.io.InputStreamReader(clientSocket.getInputStream()));
    pw = new java.io.PrintWriter(clientSocket.getOutputStream(), true);
    String message = br.readLine().trim();
    System.out.println("message is"+message);
    pw.close(); // close everything
    br.close();
    clientSocket.close();
         catch (Exception ex) {
    ex.printStackTrace();
    }

  • How to choose a specific port via Palimpsest?

    I found out today that Palimpsest Disk Utility can access remote harddrives via the SSH protocol. But Im not running SSH on my server via port 22. How do I choose a specific port?

    galo,
    willkommen zu den Apple Diskussionen.
    You don't state which version of Keynote you're using. Keynote 3 offers an option to restart the presentation after an inactivity of x min (at least 1 min).
    Look at Document inspector on the Document tab.
    In German: Klick im Informationen-Fenster auf das weiße Blatt und ggf. den Dokument-Button. Dort findest Du:
    Präsentation als Endlosschleife
    Präsentation neu starten nach Inaktivität von
    Viel Erfolg.
    If this information is useful to you, please mark it as "helpful" or "solved" using the little buttons in the titlebar of this message. Thank you.
    PowerBook G4 17", 1GB   Mac OS X (10.4.7)   iMac G5 20"; iPod 3G, iPod Shuffle, iSight

  • Can I connect an external hard drive to one of the ethernet port of the airport extreme and access it from my Mac or PC?

    Can I connect an external hard drive to one of the ethernet port of the airport extreme and access it from my Mac or PC?

    If this hard drive is part of a NAS device, then yes it should be accessable from either a Mac or PC while connected to the AirPort Extreme Base Station (AEBS) by Ethernet.

  • I keep getting error 3004 when i try restoring and updateing my iphone 4 to iOS 7 i did everything 1. flushed dns 2. edited hosts 3. updated itunes and downloaded new one 4. switched usb ports 5. disabled antivirus 6. enabled ports 80 and 443 7. disabled

    I keep getting error 3004 when i try restoring and updateing my iphone 4 to iOS 7 i did everything 1. flushed dns 2. edited hosts 3. updated itunes and downloaded new one 4. switched usb ports 5. disabled antivirus 6. enabled ports 80 and 443 7. disabled firewall 8. even tryed putting mobile in DFU mode to restore it not of this worked so please help me

    please replyyy i'm stuck on this like whole week

  • How to add one form to specific responsibility

    Hi ,
    I need help from you guys regarding how to add one form to specific responsibility,having sysadmin responsibility i can able to view that form name but don't have idea how to include the form to that particular responsibility.
    Much appreciated for your help
    Thanks,
    Babu

    1. Query the responsibility name (from Security > Responsibility > Define) and get the menu
    2. Navigate to Application > Menu, and query the menu you got from the previous step
    3. Add the form to the menu
    Thanks,
    Hussein

  • How do I ping a specific port (from a specific por...

    Does anyone know of any software that will allow me to measure the bandwidth/throughput/travel time/etc of packets from a specific port to a specific port on another network? Ping gives the travel time, but doesn't allow specified ports. Iperf allows you to specify the port you connect to, but not the port you connect from. Wireshark doesn't send packets, though I think it does record traffic by port. Pathping is the same as ping in that it doesn't "do" ports & neither does tracert (and ping/pathping/tracert traffic may well be blocked where normal traffic isn't). So, does anyone have any ideas (or is friendly with their comapny's network admin)?

    Llama8
    did a quick google and came up with this:-
    http://www.elifulkerson.com/projects/tcping.php
    seems to do the trick but not sure you can specify the source port on the pinging machine
    its a start though
    Never tried this so caveat emptor
    banz

Maybe you are looking for