Two applications wants to read on the same port using Socket

I have an application running on one machine using TCP/IP socket. The data transfer with the other application on other machine is in ASCII.
Now I want a new application that can have a copy of data received and sent on the given port, where the previous application is running.
Is it possible in Java using socket and TCP/IP to have two application reading data from the same port and both can read all the data.

Even when you don't state the type of app which need to read the data stream (is it a server or a client app???), it's impossible to share a single TCP/IP socket among multiple apps.
Perhaps the best thing to do is to develop something like a proxy server who listens on the nominated port and provides to contact (if your apps are server ones) or to be contacted (if your apps are client ones) by the desired apps.
This way, the only job for the proxy is to duplicate the contents of the data stream and make them available to all the apps engaged.
Hope this helps.

Similar Messages

  • HELP!!: Two server application instances could work in the same port?

    Hi everybody!!!
    i have two server application instances over the same JVM and both of them need to get requests from the same port, how can i get this??
    I`m not interested on using RMI, and i wouldn`t like to use sockets, because i have already using XML-RPC, so if you can tell me how can i get this without using sockets nor RMI, please help me...
    I don�t if there any way using threads??
    thanks a lot,
    JCPARRAM

    Two sockets can't be bound to the same port on the same machine at the same time. This means that one application can't have two sockets listening on the same port and that two applications can't each have a socket listening on the same port (no matter what language they are written in, and, if they are in Java, no matter whether they are on the same JVM or not).
    Your only solution is to make one of the server applications listen on a different port.

  • Is it possible for two servers to receive broadcasts on the same port?

    I'm trying to run multiple instances of a class that creates a UDP socket that receives broadcast packets on a specific port:
    socket = new DatagramSocket(port);
    The second and succeeding instances get a BindException because the address is already in use. Is there a way to have multiple servers on a specific port?

    It works. So now instead of just new DatagramSocket(port), my code now reads:
    socket = new DatagramSocket(null);
    socket.setReuseAddress(true);
    SocketAddress sockAddr = new InetSocketAddress(port);
    socket.bind(sockAddr);
    Thanks.

  • Reading the same port on the same machine

    Hello,
    i'm working on DatagramSocket to broadcast DatagramPacket (IP 192.168.xxx.255) and a fixed num port. The problem is that I can't have 2 threads that read (datagramSocket.read) on the same port, on the same machine.
    How can I perform my tests ?
    java.net.BindException: Address already in use
    at java.net.PlainDatagramSocketImpl.bind(Native Method)
    at java.net.DatagramSocket.bind(DatagramSocket.java:368)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:210)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:261)
    at java.net.DatagramSocket.<init>(DatagramSocket.java:234)

    Well, the short answer is that you can't.... at least I've never heard of a way how. Basically, when an application requests a port number, it basically owns that port number until it gives it up. You do this when you create the DatagramSocket. Each DatagramSocket is its own request, and therefore must have an unique identifying port. Otherwise, how would your operating system know who to give the data to when it receives a packet on your machine for port XXXX? Also, it would be a secuirity problem if other applications could listen on the same port as you use for other things like surfing the web, making online purchases, email.
    However, what you could do is have one owner of the DatagramSocket... and share it among the other threads. When that owner receives a packet, it can notify the other threads it received a packet and pass the data to each one. Set it up something like how listeners work. Also, if you want it to span processes, you could use RMI or pass the data through other deined network connections between the processes.
    Does that make sense? :)

  • I have just signed upfor family sharing. Is there any way you can get the same app on two devices but not have to share it? My sons both want clash of clans but they don't want to be on the same village and they can't both be on app at the same time?

    I have just signed up for family sharing. Is there any way you can get the same app on two devices but not have to share it? My sons both want clash of clans but they don't want to be on the same village and they can't both be on app at the same time?

    hi, the app is not "shared", it works as if you bought the app twice with different accounts, only you paid it once. they should have 2 different villages since they're on 2 different devices.

  • HT204053 If two separate iPhones are signed into the same AppleID can the iMessages be read on both devices?

    If two separate iPhones are signed into the same AppleID can the iMessages be read on both devices?

    Welcome to the Apple Support Communities
    You're right

  • Two separate enterprise WiFi networks in the same building

    I work in a building that currently has Cisco controller based access points. The access points aren't managed by us and are actually part of another campus. We are given access to them but they don't work quite like we want them to. So we are wanting to bring in our own Cisco WLC 2504 with 3702 APs. But when we brought this up with the main campus they said we can't have two separate enterprise wireless networks in the same building. That their APs will mark our APs as rogues and try to shut them down. There was also mention that they can't share the same channel and that the radios will negotiate with each other to determine how much power they need for coverage. But from what I've read none of that is true. So maybe I misunderstanding something and hoping someone here with more experience can shed some light on this. The only reason we would want to keep their wireless in the building is so when their staff come to our office they can use it. 
    So can two separate WLC/AP systems on different subnets and broadcasting different SSIDs exist in the same building with out causing any issues?

    By default, the WLC code does not try to contain rogue AP's.  Just lots of alarm's and unclassified rogue's.
    In this case you hosts may have actually enabled containment but would have also received a screen full of warning about the public nature of the unlicensed wifi band.
    Here the Superior Court system is side by side with the County system even to the extent that the AP's are next to each other.  Gets fun.  Since each SSID constitutes a rogue, each unit represents a LOT of rogues to report.
    Good Luck

  • We have two Apple ID's but share the same computer....that runs Itunes...How do i setup Icloud for ea. user ID?

    We have two Apple ID's but share the same computer....that runs Itunes...How do i setup Icloud for ea. user ID?

    You can't merge Apple IDs.  What you could do is set up your phone to use the same iCloud accout you are using on your Mac.  To do this, go to Settings>iCloud and turn all synced data (Contacts, Calendars, etc.) to Off.  When prompted, choose to keep the data on the phone.  When everything is off, scroll to the bottom and tap Delete Account.  Now add the iCloud account you set up on your Mac (with the same Apple ID) and turn syncing back on for Calendars, Contacts, etc.  When prompted, you will probably want to choose merge, to merge the data on your phone with the existing data on this iCloud account.

  • Somehow I have two sign-in email addresses for the same iTunes account. How can I fix?

    I believe it started with Mobile me, but not sure. I have apps that I've downloaded using an old sign-in email address and apps that I've downloaded (to the same Mac) using the newer sign-in email. I can access iTunes with the newer address. But I often get prompted to input my old sign-in email address (and old password) when upgrading certain apps. It's very annoying. And now I've moved all my files to a new computer and it won't allow my apps from the old sing-in to sync without authorizing the computer first  (which it already is, but isn't recognizing as much with the old email address...).
    Help.

    I suspect what you have ended up with is two AppleIDs/accounts.  You cannot merge content.  Decide which one you want to use and use that one for future purchases.  For previous purchases you will have to make sure the other one is kept updated in terms of contact information and you will have to use it to access its content.

  • HT4061 How do I consolidate purchases from two different ids that are on the same bank account, and eliminate the extra id without losing any purchases?

    How do I consolidate purchases from two different ids that are on the same bank account, and eliminate the extra id without losing any purchases? I want my music to match on both ipad and computer.

    Purchases are forever tied to the AppleID they were bought with. There is currently no way to consolidate AppleIDs. Sorry.

  • SUM two fileds from different rows from the same table

    I would like to SUM two fileds from different rows from the same table but I don't know how to do that.
    E.g.
    BillingTransactionsIndex      CreateDate      UserType      UserIndex      TransType      Reference      Total      Balance
    2      6/5/2008 15:02      1      51      1      150      -288.2      -288.2
    5      6/8/2008 11:55      1      51      1      157      -1.58674      -289.787
    In the table above I want SUM fields Total and Balance for the first row and the the next row SUM 2nd row Total with 1st row Balance
    Please help
    Thanks

    SQL> with tbl as
      2  (select 1 as ID,  90 as total from dual
      3          union all
      4  select 2 as ID,  23 as total  from dual
      5          union all
      6  select 3 as ID,  15 as total  from dual
      7          union all
      8  select 4 as ID,  20 as total  from dual)
      9  select id , total, sum(total) over (order by ID) as balance from tbl
    10  /
            ID      TOTAL    BALANCE
             1         90         90
             2         23        113
             3         15        128
             4         20        148
    SQL>

  • Can't print TWO 5 x 7 photos on the same page!

    I recently updated from Photoshop Elements 7 to Photoshop Elements 10 and now I cannot print TWO 5x7 photo's on the same page, letter size photo paper! I've never had this problem before! Does anyone know how to fix this? I have tried everything! Thanks Julie

    Hatstead, I've already tried that and two 5 x 7's will not show up on the preview screen! I'm pretty familiar with all the printing preferences and have tried every concievable option to try and print two 5 x 7's to the same page.  I can go back to my version 7 Photoshop Elements ( havent uninstalled it yet) and print two 5 x 7 photos to the same page with no problem! I'm really beginning to believe that version 10 does not support printing more than one photo to a page even when you want to print say a bunch of 2 x 3's to the same page. Even when i try to print one of the picture packages it will only print one pic to a page at a time!!!!  Something can't be right! I only print two 5 x7's to a page 95% of the time, so this is a HUGH problem for me! Thanks for any help you can give me.

  • Two or more people editing at the same time

    Dear All,
    I am planning to purchase FCP Server, and I am just in a very beginning of consideration.
    Immediately, I am wondering if FCP Server can let two or more people editing on the same project at the same time.
    I know it has Check-in function, and it seems to me that it just takes the project to another computer to do editing. What if another person wants to do editing on the same project?
    Also, if it allows us many people to do editing on the same project, can we save the project at the same time on the same computer installed FCP Server?
    Please advise.
    Many thanks in advance.
    King

    In Final Cut Server (FCSvr) checking out a Final Cut Pro project (FCProj) creates a copy of the project file at a location you specify saving it to on your local computer. When you check out a FCProj, the project asset is locked and cannot be modified by other users. Additionally, every media asset that is used in the project is locked from being modified by other users.
    However in a you're trying to have multiple users work on and edit the same project, I'd suggest start by duplicating the FCProj asset within FCSvr. Maybe start with a master capture / digitize project that contains all the media needed to work on by both editor. This will allow for multiple editors to have access to the same project media assets. In any scenario where multiple editors are collaborating, I'd suggest have them also work on separate project file and maybe split / divi up the work, based on scene, act etc.
    Sequences can be easily merge between project later.
    Hope this helps.
    Nicholas Stokes
    XPlatform Consulting
    < Edited by Host >

  • Can I export my sidecar files to two or more hard drives at the same time from one computer?

    Can I export my sidecar files to two or more hard drives at the same time from one computer?  How do I do this, if it is possible?

    Each image is imported into the LR Catalog from just one stated location on disk. And that is where the sidecar gets written.
    But if you want, outside of LR, you can have a file sync utility replicate all physical changes within those folders on disk, into other corresponding locations on other drives - which hold a copy of all the same images, and a copy of the sidecars too. This might happen continuously, periodically or on demand depending on the particular tool you use... for example, the Dropbox desktop app.
    If you also want to have your LR Catalog replicated, I think this can only be done when LR is not running and using that.

  • If you registrate one Apple ID for each iPhone/iPad, you'll get 5GB on iCloud for each Apple ID, right? I have two iPhones and one iPad  with the same Apple ID, why can't I get 5 GB fo each of them?

    If you registrate one Apple ID for each iPhone/iPad, you'll get 5GB on iCloud for each Apple ID, right? I have two iPhones and one iPad  with the same Apple ID, why can't I get 5 GB fo each of them?

    Actually, everyone missed one point, when a device is priced, the cost of icloud storage space for that device is also included in it that is why they are able to give you 5gb each for each user ID, in nutshell there is nothing free coming with apple device purchase, it is paid for.  What they are trying by giving only 5gb per user ID irrespective of the number of devices used is pure broadlight looting, they take money from you when you buy each device and give you nothing, This is a case of goods and services bought but not fully deliverd ie apple can be suied for discreminatory treatment towards it's users. I wonder why no one tried this yet in America where everyone sue everyone for petty things..... there is no one to take up this issue? . if tim got any love for the guys who shell out money for the devices his company makes, he should be implimenting this as priority before someone wake up from sleep and sue him.

Maybe you are looking for

  • Auto Add from pc to iTunes Library

    I have my library folder set to the standard my documents/my music/itunes/itunes music. When I add a song to the folder, it doesn't automatically get added to my library. I have to either choose add file and select it, or choose add folder and select

  • I have problem with driver.

    I use hp probook 450 g1 J7V41PA and win 7 ultimate x64, i tried ti reinstall win 7 few times but this problem alsway showup: 1.PCI Simple Communications Controller: PCI\VEN_8086&DEV_8C3A&SUBSYS_1942103C&REV_04 PCI\VEN_8086&DEV_8C3A&SUBSYS_1942103C PC

  • OData and JSON light support, When?

    Anybody knows when OData will be shipping with support for JSON light?? I'm kinda sick of those "_metadata" tags cluttering up my JSON. Thanks!

  • Reg : F4 help in webdynpro

    Hi, Am developing Webdynpro Application to Connect R/3 by using Bapi's. My question is : Is it possible to bring field contents(f4 help contents) in webdynpro ?. Thankyou, Ramganesh.

  • Moving script b/w clients

    Hi All, I am working with a script in which i have to copy the script from another and make changes. I am working on client 10 and i have to test data in client 50. I have copied the original script from client 10 and made changes. Now how to move th