Multiple connections to the same port

Hi,
I'm trying to develop a server to which multiple user must be able to connect to. I want the server running at one predefined port (1666 for example) and all users should be able to connect to it. Since Sockets can only handle one connection per port, how can I make users redirect to another port after they have connect to 1666, so it's free for another user to connect? Or is there any other solution?
Many thanks in advance.

Ain't I doing that right now? Here's the code I use for accepting connections:
            while(true) {
                try {
                    ServerSocket ss = new ServerSocket(PORT);
                    Socket client = ss.accept();
                    this.state = "client";
                    this.client = client;
                    Thread clientT = new Thread(this);
                    clientT.start();
                    try {
                        Thread.sleep(100);
                    } catch(InterruptedException ie) { }
                    client = new Socket();
                } catch(IOException io) {
                    System.out.println("[" + new java.util.Date().toString() + "] IOError: " + io);
            }Anyway, thanks for your reply

Similar Messages

  • Multiple connections for the same user.

    I have EJB A and EJB B. A and B use a JCA connector that
              I have written. I have matchManagedConnections set so that if user U has not used EJB A or EJB B, then a new ManagedConnection is created. If user U has used A or B then that user is given a new virtual connection created from an existing ManagedConnection. Now the problem is that if user U access' A for the first time and then access' B BEFORE A has closed the connection, then a new ManagedConnection is created for user U. Therefore in this case user U gets 2 ManagedConnections to the EIS that we are using. Eventually one of the ManagedConnections is distroyed but I would like to eliminate this in the first place. How do a get Weblogic to see that a user has a ManagedConnection before that user is done with the connection.

    You can't have multiple roles on multiple connection, as you are connecting to the same website (different sub directories) ultimately.
    Here is the workaround:-
    You can create a new user account on your machine and can manage different roles.
    Hope it helps.

  • Two computers connected in the same port dot1x in 3750 in different time.

    I have the following consultation.
    I have a "computer A" connected to a port of switch 3750, configured with: dot1x port-control auto
    dot1x timeout quiet-period 5
    The "computer A" is authorized.
    When I disconnect the "computer A" and I connect a "Computer B", this is not connected, but when I connect the "computer A" again if is connected.
    How many time I should expect to be able to connect the "computer B" in the same port of the 3750?

    When the switch cannot authenticate the client, the switch remains idle for a set period of time and then tries again. The dot1x timeout quiet-period interface configuration command controls the idle period. A failed authentication of the client might occur because the client provided an invalid password. You can provide a faster response time to the user by entering a number smaller than the default.
    The value after the quiet-period is in seconds, so in your case, the switch will wait five seconds before it re-tries for another authentication for the new device connected.
    Please rate helpful posts.

  • Problems with multiple connections in the same transaction

    Hi all !
              I'm have two questions regarding the way weblogic handles multiple
              connections.
              1) first, I don't understand why weblogic always create a new Managed
              Connection when I'm asking for 2 connection handles on the same connection
              factory and with the same connectionRequestInfo. Isn't it supposed to share
              connections ?
              For instance, the following snippet of code results in the creation of 2
              managed connections:
              ConnHandle conn1 = myCF.getConnection(myRequInfo);
              ConnHandle conn2 = myCF.getConnection(myRequInfo);
              The class corresponding to myRequInfo does implement the equals and hash
              method, so that weblogic's connection manager could use them to check that
              the queried connections are the same, and thus could share a single
              ManagedConnection between multiple connection handles. Apparantly it does
              not do that...
              2) OK, I just let weblogic create the 2 managed connections, but... My use
              of the connections is as part of a transaction. Here is what happens:
              ConnHandle conn1 = myCF.getConnection(myRequInfo);
              // a new managedConn1 is instanciated. the following happens (just a
              description)
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS)
              // I use the conn1 handle
              conn1.close();
              //xar1.end(SUSPEND)
              ConnHandle conn2 = myCF.getConnection(myRequiInfo);
              // a new managed connection managedConn2 is instanciated.
              // xar2 = managedConn2.getXAResource();
              // xar2.start(RESUME)
              // I use conn2 handle
              conn2.close();
              // xar2.end(SUSPEND);
              // my bean returns from the remote invocation
              // the client of the bean asks to commit (using UerTransaction.commit on the
              client side)
              // xar2.end(SUCCESS)
              // xar2.commit(onePhase=true);
              // managedConn2.cleanup();
              And that's all. So, as one can see, managedConn1.cleanup was never called.
              When looking in the weblogic console, I can see that I have one connection
              with 0 handle and one with 1 handle, deemed as still being in a transaction.
              So, the conenction manager apparantly loses a managed connection during the
              transaction. And it's very very bad because after a couple of transactions,
              I'm running out of managed connections (I had set a limit of 10).
              Any one has seen such a weird behavior ? Is this a problem on my side, or
              weblogic's ? Thanks for your help.
              Sylvain
              

              I ran another test. This time I have a bean that makes use of a connector
              once per method invocation. The bean method invoked is "sayHello" and it
              gets a connection to the EIS, perform an operation on it and release it. The
              connector I developed uses XA transactions.
              My test client just calls 3 times myBean.sayHello().
              I can distinguish two cases:
              1) first, the client doesn't do transaction demarcation. In this case, since
              the sayHello method is marked as requiring transaction, the folowing happens
              in the bean:
              // **** first invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn1 is instanciated
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar1.end(SUCCESS);
              // the bean returns from its invocation
              // xar1.commit(onePhase=true)
              // managedConn1.cleanup()
              // **** second invocation of the bean
              connHandle = myCF.getConnection();
              // managedConnectionFactory.matchManagedConnection is called. It returns the
              managed connection (managedConn1) that is in the passed set
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close
              // xar1.end(SUCCESS);
              // the bean returns from its invocation
              // xar1.commit(onePhase=true)
              // managedConn1.cleanup()
              // **** third invocation of the bean
              connHandle = myCF.getConnection();
              // managedConnectionFactory.matchManagedConnection is called. It returns the
              managed connection (managedConn1) that is in the passed set
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close
              // xar1.end(SUCCESS);
              // the bean returns from its invocation
              // xar1.commit(onePhase=true)
              // managedConn1.cleanup()
              2) second case : the client performs transaction demarcation. In that case,
              the connection manager instanciates 3 managed connections, calls start/end
              on each XAResource corresponding to each managed connection, calls commit
              once, but also calls cleanup only once, leaving 2 lost managed connections
              The client looks like this:
              UserTransaction utx = context.lookup("javax/transaction/UserTransaction");
              utx.begin();
              MyBean myBean = ctx.lookup(".......");
              myBean.sayHello();
              myBean.sayHello();
              myBean.sayHello();
              utx.commit();
              on the server the following happens:
              // **** first invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn1 is instanciated
              // xar1 = managedConn1.getXAResource()
              // xar1.start(NOFLAGS);
              // managedConn1.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar1.end(SUSPEND);
              // the bean returns from its invocation
              // **** second invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn2 is instanciated
              // xar2 = managedConn2.getXAResource()
              // xar1.isSameRM(xar2) is called. returns true
              // xar2.start(RESUME);
              // managedConn2.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar2.end(SUSPEND);
              // the bean returns from its invocation
              // **** third invocation of the bean
              connHandle = myCF.getConnection();
              // managedConn3 is instanciated
              // xar3 = managedConn3.getXAResource()
              // xar2.isSameRM(xar3) is called. returns true
              // xar3.start(RESUME);
              // managedConn3.getConnection gives a connection handle
              connHandle.doSomeWork();
              connHandle.close()
              // xar3.end(SUSPEND);
              // the bean returns from its invocation
              // the client invokes commit on the UserTransaction
              // xar3.end(SUCCESS);
              // xar3.commit(onephase = true);
              // managedConn3.cleanup();
              And so, managedConn1 and managedConn2 got lost in the way...
              What's more puzzling, it's that when monitoring my connector with the
              console, I can see that there are 3 connections. 2 declared as still having
              one handle used and being in transaction, and one not in transaction and
              with 0 active handle. BUT when monitoring the JTA part of the server, I can
              see that there has been 1 transaction that committed, and no connection is
              "in flight" as the console says. So, on one side the console says 2 managed
              connections are still part of a transaction while on the other it says that
              no transactions are currently in flight.
              Thanks for any kind of help on this very bizarre behavior.
              Sylvain
              

  • Multiple operation using the same port does not work

    I am trying to have multiple operations on both ports
    here is my wsdl snapshot
         <portType name="CommonAlerter">
              <operation name="initiate">
                   <input message="client:CommonAlerterRequestInitMessage"/>
              </operation>
              <operation name="StartWait">
                   <input message="client:CommonAlerterRequestInitMessage2"/>
              </operation>
              <operation name="StopWait">
                   <input message="client:CommonAlerterRequestInitMessage3"/>
              </operation>
         </portType>
         <portType name="CommonAlerterCallback">
              <operation name="onResult">
                   <input message="client:CommonAlerterResponseMessage"/>
              </operation>
         </portType>
    I just added two new methods "StartWait" and "StopWait" to the default async. template that got generated when I created a new BPEL Project "CommonAlerter"
    Now I call this BPEL process from another BPEL project
    The three methods I call "initiate", "StartWait" and finally "StopWait" are at different stages in my calling BPEL processes. Although "initiate" gets called first.
    When I debug the calling process instance I get an error on the call to "StopWait" which gets called after "StartWait".
    Here is the error message
    Exception not handled by the Collaxa Cube system.
    An unhandled exception has been thrown in the Collaxa Cube system. The exception reported is: "ORABPEL-08010
    Failed get operation definition.
    Failed to get the WSDL operation definition of "StopWait" in portType "{http://xmlns.oracle.com/CommonAlerter}CommonAlerter".
    Please verify that operation "StopWait" is defined in portType "{http://xmlns.oracle.com/CommonAlerter}CommonAlerter".
    Now I do have this method in my WSDL
    Can some one help.
    My Message part XSD is
         <element name="CommonAlerterProcessInitRequest">
              <complexType>
                   <sequence>
                        <element name="initializeparam" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="CommonAlerterProcessResponse">
              <complexType>
                   <sequence>
                        <element name="result" type="string"/>
                   </sequence>
              </complexType>
         </element>
         <element name="CommonAlerterProcessRequest2">
              <complexType>
                   <sequence>
                        <element name="waittime" type="duration"/>
                   </sequence>
              </complexType>
         </element>
         <element name="CommonAlerterProcessRequest3">
              <complexType>
                   <sequence>
                        <element name="stopargument1" type="string"/>
    <element name="stopargument2" type="string"/>
                   </sequence>
              </complexType>
         </element>

    Here are the steps for multi operation synchronous BPEL process :
    1.     Create a new BPEL process and delete request and response activities.
    2.     Now add the porttype/operation in the BPEL process wsdl.
    3.     Start the Process with a Pick activity and click on Create Instance checkbox. Remove the onAlarm branch as we do not need this. In the onMessage branch specify the name of the operation.
    4. Now add onMessage branches to match the number of operations. The flow for each onMessage branch is different. Just make sure that you create a reply activity at the end with the correct operation chosen. So you might end up having multiple return activities.
    Sometimes, a wsdl with multiple operations might not work as expected if the process version is 1.0. So try changing the process version in case you are not getting the expected results.
    Hitesh

  • Multiple connections/roles on same machine for same site?

    As a Contribute CS3 Administrator (newbie; just converted a
    Dreamweaver site to work with Contribute), can I set up multiple
    connections to the same site? I want to test the Publisher role and
    Writer role on my development machine before creating connnection
    keys for these roles for the customer who owns the site (and is
    waiting with new Contribute licenses and eager but idle staff)?
    I just want to be able to test my site under these roles
    (using different passwords and username/email addresses), but there
    seems no obvious way to do this as Contribute seems to allow me to
    set up only one connection per URL, and also seems to want to wipe
    out my existing Admin connection if I come on in another role (from
    a connection key generated for a Publisher or Writer role).

    Two problems with that:
    1. Tried it by creating a connection key for a Publisher
    role, but invoking the key zaps the old connection, so I no longer
    have Administrator access without deleting then re-creating the
    connection and setting myself up as Admin again.
    2. When I went into the (new) connection as Publisher, it
    would let me connect and see pages, but would NOT allow editing of
    any pages (even though I had specifically looked when originally
    defining the role to make sure all editing privileges were -- or
    appeared to be -- intact).

  • How do I open the same ports on an Airport Extreme Base Station for multiple computers at the same time?

    As the title suggests...
    I have a mix of five Mac and PC's at home using an Airport Extreme Base Station as the router.   I need many ports opened on the AEBS for all of the computers- not just one computer.  (for example: three people want to play TF2 on Steam at the same time; each machine needs the correct ports open on the router).   Port forwarding  only allows me to forward a given port to a single IP, yet I need that port open for five differnt IP's, all at the same time. 
    How do I do that on an AEBS?
    In the same way, I have a small office of four iMacs using an old airport with the same exact issue.   I would like to be able to connect to all of them remotely with Apple Remote Desktop, but the port forwarding on the airport only allows a port to forward to a single IP.   I want to be able to tunnel into the office network and log onto any machine behind the Airport extreme... not just a single IP.    I currently have it set up where I can tunnel into the office from my house, I can find the one machine that the port forwarding has been assigned to, I can log on and everything is just fine... with one machine.    How do I open the firewall for the other machines? 
    TL,DR version:  How do you open ports on an Airport Extreme Base Station instead of forwarding ports?   Forwarding ports doesn't work for multiple IP's.  

    You can open a single or multiple ports to a single device or different ports to different devices, but you cannot open the same port to multiple devices via the AirPort Utility for the Apple routers.

  • Solaris 8: Multiple primary interfaces connected to the same network

    I have a machine with Solaris 8, and it has multiple interfaces that are connected to the same network which means they all have metric 0 (1 hop) to the default gateway.
    assume:
    e1000g0: 192.168.30.70
    e1000g2: 192.168.30.72
    e1000g4: 192.168.30.74
    e1000g5: 192.168.30.76
    gateway: 192.168.30.65 (Cisco Router)
    However, it seems like despite the fact that they have a direct connection, they seem to be using e1000g0 to access the 192.168.30.0 network to get to the default gateway and then to anywhere else.
    When I send a ping to say, 192.168.30.74 (IP of e1000g4) and capture packets on e1000g0, I see the "echo reply" messages going out of it as opposed to e1000g4 even though e1000g4 is the one receiving the "echo request". This should not happen and these should be completely independent as they should all be advertising a 1 hop to that network
    The outputs from netstat -rn and ifconfig -a are shown in the picture on the link below
    [http://img836.imageshack.us/img836/7308/ifconfignetstathiddenip.jpg]
    This gets even more confusing when I go into the Cisco router and run the command: "show mac address-table" where only the MAC address of e1000g0 is shown for the switch port it's connected to, but not for the other interfaces which are connected to the switch. Yes, all ports are active (no shut) and are pingable.
    Also, the odd thing is that ALL of these individual MACs show up in the router ARP table when the machine comes up, however after sending a ping to one of them, after a certain expiry or whatever period, the MACs disappear from the router ARP table and only the MAC for e1000g0 shows up. The arp table of the solaris machine however shows all the relevant MACs of each port of the router that it's physically connected to (This is actually a Cisco Switch with the advanced IP services imagine and L3 routing turned on)
    Before anyone asks: The setting local-mac-address? setting does NOT exist in my machine and it never has, but it used to work fine. Also, from the ifconfig command, once can tell that all the MAC addresses are fine.
    I need to somehow assign all these interfaces equal priority and make them understand that they're physically connected to the 192.168.30.0 network and there's no need to go through e1000g0 to get to it.
    This is causing a lot of problems as eventually all traffic will end up going through the e1000g0 interface and that will become a bottle neck.
    Please help Thanks in advance

    Ok thanks. That was a useful response.
    I did think about the trunking software that is claimed to be available for Solaris 8, but it's only available if you've got paid support contract. Oracle came and ruined everything re: Sun support which is so expensive now.
    The other confusion is, we never had that OR needed to configure trunking/link aggregation on this machine, so why now?
    Lastly, by your explanation, this should be expected and is "normal" behaviour, which would mean that this machine was always doing this and I only just noticed it this time? I thought if you turn off ipv4 forwarding and router function in the machine, it's every interface for itself. But it's not doing that :(
    So then the question is, Can I force it? I've tried a bunch of things by manipulating the tables and it seems to mess things up where nothing is getting through or it now shifts all the traffic to some other port make the problem no different
    Is there a way to give equal weight to all interfaces for the traffic to go directly through them that is originating at those ports?

  • Allow Multiple Computers Access To The Same Port

    I just received my AEBS in the mail this afternoon & set it up in no time. My college house has two Xbox 360s connected to the AEBS & I would like to open the NAT ports on both. I'm able to successfully forward the ports to allow an open NAT for one Xbox, but the Airport utility doesn't allow me to open the same ports for the other Xbox.
    Is there a way to open a port to everyone connected to the router, or maybe a way to open a specific port used by multiple Private IP Addresses?

    Sorry, but no. Port mapping forwards inbound a single, or range, of ports (in one definition) to one single machine only. So, for example, you could not map port 25 to multiple email servers on your LAN. However, you could map port 25 (for email) and port 80 (for web) to a single device.

  • Multiple iPod shuffles to connect to the same computer

    Is there any special instructions to have two iPods that my family would want to connect to the same computer?
    Each family member has our own playlist and we'd like to update our own iPod shuffles with our own playlists. The first iPod shuffle we bought works fine, but I'm having trouble getting the second iPod to be recognized.
    thanks in advance for your help

    Marc,
    I have two iPod Shuffles supported by a single Dell Desktop running Windows XP/SP2. I'll relate my experience and hope that helps you. My first Shuffle was a 512Mbyte. I installed the iTunes software from the CD that came with the Shuffle, and then plugged the Shuffle into the USB port at the bottom front of the Dell. It was recognized by Windows and by iTunes and I was directed to register the Shuffle with Apple. I named the Shuffle and that name appears in the iTunes Source List. Then I acquired a 1Gbyte Shuffle for my wife. I DID NOT re-install iTunes from the new CD (although I made sure that the existing iTunes was the latest version 4.7.1). Now with iTunes open, I plugged my wife's Shuffle into the same USB port as I use for my Shuffle. Once again, the new shuffle was recognized by both Windows and iTunes and, once again, I was asked to register the second Shuffle and give it a name (of course, different from the other Shuffle). Now both Shuffles appear in the Source List. I only plug one Shuffle in at a time, and the Shuffle that's plugged-in has a little "up-arrow" appear to the right of its name in the Source List. I am the administrator and only user of the Dell, so there's no "partitioning" problems that might screw up the support of multiple Shuffles -- your family members may have separate accounts on your computer, but I'd suggest that only one (and always the same) user logon to access iTunes and the Shuffles.
    Good luck.
    Roger

  • Tries to connect multiple times at the same time a...

    Tries to connect multiple times at the same time after trying to reinstalling software.

    Hello,
    Assuming that you use a Web version (this information MUST be provided in any post), you have 2 ways to run reports:
    1. the Run_Report_Object built-in
    2. the Web.Show_Document() built-in
    Francois

  • I have a serious contacts redundancy problem.  First I have multiple email account formats, e.g., 2011 MacOutlook, 2008 Entourage, 2007 Window Outlook, iPhone Exchange and these are all connected to the same account.  The problem is I had up to 15 contact

    I have a serious contacts redundancy problem. 
    First I have multiple email account formats,e.g., 2011 MacOutlook, 2008 Entourage, 2007 Window Outlook, iPhone Exchange and these are all connected to the same account. The problem is I had up to 15 contacts for the same person. 
    I deleted the Entourage contacts as that seemed to be the program that was causing the problems.  When I synced this morning, now all my contacts are gone from every where. 
    How can I restore to my last back?  If I restore, it will ask to restore to the back that was just made… which has no contacts?  
    Help would be greatly appreciated !!

    I have a serious contacts redundancy problem. 
    First I have multiple email account formats,e.g., 2011 MacOutlook, 2008 Entourage, 2007 Window Outlook, iPhone Exchange and these are all connected to the same account. The problem is I had up to 15 contacts for the same person. 
    I deleted the Entourage contacts as that seemed to be the program that was causing the problems.  When I synced this morning, now all my contacts are gone from every where. 
    How can I restore to my last back?  If I restore, it will ask to restore to the back that was just made… which has no contacts?  
    Help would be greatly appreciated !!

  • Multiple listeners on the same IP and Port - is this possible?

    Hi all,
    I think I know the answer but thought I'd ask anyway, as someone might have some suggestions.
    So in IIS we can have multiple websites bound to the same IP - this is called "Hostname binding", and means that IIS will check the Host header of incoming traffic before deciding on what to serve.
    Can we do anything similar in TMG?
    Or, if I want to handle requests for the same port (443) for multiple applications, do I simply need to get another IP address an interface onto the TMG box?
    Thanks in advance.

    Hi,
    When you publish multiple Web sites with different host names on the same Web server, you can install a wildcard certificate on the Web server that can be used to prove the identity of the Web server to the Forefront TMG computer. A SAN certificate can also
    be used.
    There is a article describing how  to configure Web publishing rules in Microsoft Internet Security and Acceleration  2004 (ISA 2004) Server or Microsoft Forefront Threat Management Gateway, Medium Business Edition to redirect HTTP requests from
    the Internet to a specific internal Web server by using the original host header.
    http://support2.microsoft.com/kb/838252/en-us
    Best Regards,
    Joyce
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Has anyone tried to pair the Tzumi bluetooth headphones to their iMac?  My iMac will detect the device, connect to it for about 2 seconds, then shows a status of "not connected".  Multiple attempts get the same result.

    Has anyone tried to pair the Tzumi bluetooth headphones to their iMac?  My iMac will detect the device, connect to it for about 2 seconds, then shows a status of "not connected".  Multiple attempts get the same result.

    Edge has very clear restrictions, one being that you must have 6 months of clean payment history which you don't. Either wait until April 14, or good luck at Sprint.
    I am unsure how it can be determined the payment mix up was the fault of CS, but regardless, the mix up was done. There can be any number of reasons why a payment could be missed without any fault on your part, however you are still the responsible party for the account and must live with the repercussions.

  • Multiple Backend Connected to the same SRM client.

    Hello All,
    We have an interesting requirement.
    We have an SRM 5.0 client with R/3 4.7 backend. Now we need to add another instance of ECC 5.0 to be connected to the same SRM client ( either on the same org stucture or a different org structure).
    I am facing difficulty in doing the material replication.
    I have the inbound queue in SRM blocked and I and getting the error message LOGSYS_FOR_GUID_CHANGED.
    This lead me to the notes 588701 and 765018. But I am not sure this would actually solve the problem.
    I have also seen the following thread which indicated that one CRM client should point to only one R/3 instance.
    Downloading basic R/3 objects into CRM with brand new systems
    Has any one so for integrated multiple backends to the same SRM client? What was your approch to the requirement?  Inviting your views and opinions to this issue.
    Thanks in advance.
    Ajith

    Hi
    You can implement corrections in the note 765018 as you mentioned in your post.
    We have done the same thing.  In case of multiple backends and also if systems are refreshed with other instances (client copy), the logical system ID will be changed.
    So we need to run the report mentioned in the said note and run the replication.
    Rgds
    Reddy

Maybe you are looking for