Multiple seperate streams to one port?

DEar all
Thanks for your help yesterday. I've given up trying to encode data and then tx it over TCP - instead I'm just going to use RTP and encode to a file at the server.
The next question I have is this:
The server will receive many connections from many clients. When a client
a) Can I use one (the same) port on the server for all clients to transmit their RTP to? If so how do I distinguish between the streams on the server? Or must I have separate ports for each incoming stream? If so, how do I find free ports for JMF to use?
b) How can I identify a particular stream as being from a particular PC (as many maybe behind the same nat). Ideally I'd like to send an identification number first.
c) How do I detect the end of the stream on the server? Or must the client tell the server via some other means?
Thanks
Gareth
Edited by: 831660 on 28-Jan-2011 02:53

a) Can I use one (the same) port on the server for all clients to transmit their RTP to? If so how do I distinguish between the streams on the server? Or must I have separate ports for each incoming stream? If so, how do I find free ports for JMF to use?You're supposed to use separate ports for each incoming stream. You should handle this situation using a normal "listen & fork" server routine.
If you're unfamiliar with the concept, you have a server that listens for incoming requests on a well-known port, and then serves the request on "any available port". Essentially it listens for a request, and then forks off a thread to handle the connection for the client on another port. That way, the well-known port isn't ever "in use"...
You'll just need to write a basic handshake protocol that your server and client can use. The server listens for requests on some defined port. When it receives a request from a client, it'll pick an unused port, transmit that port back to the client, and then start listening for an RTP connection on the port it told the client.
b) How can I identify a particular stream as being from a particular PC (as many maybe behind the same nat). Ideally I'd like to send an identification number first.A solves this issue.
c) How do I detect the end of the stream on the server? Or must the client tell the server via some other means?You're able to listen for the following events on an RTP session by registering a "ReceiveStreamListener" on your RTP session:
-- NewReceiveStreamEvent, when a new stream arrives
-- InactiveReceiveStreamEvent, when the stream becomes inactive
-- ActiveReceiveStreamEvent, when the stream becomes active again after a previous inactive event was generated
-- TimeoutEvent, when the stream times out.
-- ByeEvent, when the stream is done.
So, the end of a stream occurs when you receive a TimeoutEvent or a ByeEvent (which is a subclass of TimeoutEvent so you really only have to handle TimeoutEvents), and you may also possibly want to consider a InactiveReceiveStreamevent to be the end of a stream.

Similar Messages

  • Multiple input stream in one socket connection

    Can we have multiple input streams for a java socket connection? It means that in a client/server application (creates using java socket), can we have multiple input streams for the client side program. For example, the input streams are to cater for the need of letting the user to chat and downloading some files from the chat partner at the same time. And do we need to use thread to create the multiple input streams like the case when we create a multithreaded server? Anyone out there who knows the solution please post it. Thanks in advance.

    Can we have multiple input streams for a java socket
    connection? It means that in a client/server
    application (creates using java socket), can we have
    multiple input streams for the client side program.
    For example, the input streams are to cater for the
    need of letting the user to chat and downloading some
    files from the chat partner at the same time. And do
    we need to use thread to create the multiple input
    streams like the case when we create a multithreaded
    server? Anyone out there who knows the solution please
    post it. Thanks in advance.Ok im no expert here but this is what i learned:
    a Socket can have only one InputStream (Socket.getInputStream()) and one OutputStream Socket.getOutputStream()). So you will have to create a way to make multiple Socket connections in your client program. And yes, you have to use threads for your server. if you dont the client will have to wait until the user before them is finished with the connection before being able to connect. I hope this helps you out. BTW please check out http://www.javabible.com. they have the book online now for free.
    Joeyford1

  • Multiple sockets connected to one port

    Hello I am running a LabVIEW VI that is based on the Labview TCPServer example. I am wondering what the best way to deal with multiple connections to a single port would be. For example I have a device(could be thought of as the same thing as the TCPClient vi) that connects to the server using the port number and the IP address. The communication works fine when there is only one device trying to connect to the server, the problem occurs when two devices try to connect to the server. When the first device connects all data sent shows up fine, when the second device connects, the status on the device indicates a proper connection but none of the data sent shows up on the server side. I assume that I must do something with the connection ID to distinguish between the two connections, but I was wondering if there was an example or something that deals with this issue, or if someone would like to explain how I could get the data to show up properly. Any help is appreciated, thanks!

    I am hoping that there is something similar to the java api where there is some way I can start a new threads to handle multiple connections on the same port. I would assume that if java has it LabVIEW would have something similar. Unfortunately I am not sure how to go about finding out how to do such a thing in LabVIEW.
    The way that I assume the TCPListen.vi works is that there is some mechanism polling the specified port and ip address waiting for a request for a connection. Once a request is received the VI creates a connection ID so that the other subvi's can perform operations on the specific connection. It also looks as though the TCPListen.vi continues to listen for new connections, because the clients indicate a connection when more then one of them are run trying to connect to the same port and IP.
    So my question is either, how to start a parallel process to handle the new connections, or where can I find the new connection ID (because the indicator only shows the connection id of the first client to connect). Basically I am having trouble distinguishing between the multiple connections on the same port.I would like to keep all of the clients sending data through the same port if possible.Each client identifies itself in its data message so keeping the data organized is not a problem. 
    I also looked at the data socket examples, mainly because the Java examples I was looking at used "Sockets". I ran into similar troubles finding a way to create distinguishable connections using DS's as well. Anyways, any help is appreciated. Thanks.

  • Multiple photo streams on one PC?

    My wife and I each have iPhones and we also have several iPads in the house. We used to use one Apple ID on all the devices.  But with Family Sharing I decided to switch to each person having their own Apple ID but I don't know exactly how this works.
    I want all of our photos to be uploaded to Photo Stream on one PC.  Is this possible?  Will all of our Photo Streams be consolidated into one Photo Stream of the Family Organizer?  Or will they each be in separate streams tied to each Apple ID.  Or should I be using iCloud Photo Library. And will that consolidate the photos?

    Photo stream photos don't use any of your personal storage, but comes with limitations (up to 1000 photos for 30 days and only holds photos...and videos of 5 min or less in shared streams).  If you turn on iCloud photo library that does use your personal iCloud storage, but will host both photos and videos, limited only by the amount of storage in your account.  Also, just so you are aware, turning on iCloud photo library will remove the my photo stream album from your iOS devices, but they can still upload photo stream photos to your computer.
    I know many people are experiencing problems using iCloud photo library right now...guess that's what it's still beta.  You might have to fight it to get it to work.  Be sure to back up your original photos/videos to your computer if your going to use the current beta release.

  • Multiple out streams from one Live in stream

    Hi,
    Just wondering is there a viable way to get FMS to stream out
    different bitreates from one live stream?
    /A

    Hi Matthew,
    Welcome to SDN!
    Here is some on-line help. Let me know if you have any other questions.
    http://help.sap.com/saphelp_nw04/helpdata/en/4e/4a75bb7fe211d4b2c50050da4c74dc/frameset.htm
    Cheers! Bill

  • Multiple photo streams to one Macbook

    My wife and I each use different Apple IDs on our iPhones for iCloud and for separate Photo Streams but we only have one family Macbook.  How can both of our Photo Streams link to the one Macbook?

    How can both of our Photo Streams link to the one Macbook?
    Each of you can have their own user account and iPhoto library on the Macbook.  You can use Quick User Switching to move between the two accounts.
    There's no way to have two iCloud accounts link to the same iPhoto Library.  However, with the release of the new Photos application for the Mac early next year and iCloud Drive one account on the Mac may be able to access photos from both iCloud accounts.

  • HT201317 How do I use ICloud Photo stream on one computer with two differenet Apple Id's. My husband and I each have seperate ID's but one computer.

    How do I use ICloud Photo stream on one computer with two differenet Apple Id's. My husband and I each have seperate ID's but one computer.

    You have to have an iOS device (iPhone, iPad, iPod Touch) or Mac to create an iCloud account.  However, if you tell your friend to create a shared photo stream and turn on Public Website, he/she will then be able to send you a link that will allow you to view the photos on the internet using your web browser.  You would not be able to comment on the photos as this requires an iCloud account, but you would be able to view them.
    You can refer your friend to this link for assistance with this: http://help.apple.com/icloud/#mmc0cd7e99.

  • Forward one port to multiple ip addresses WRT300n

    Is it possible to forward one port to all IP addresses on the network. I tried to use the broadcast address but it doesnt allow that.
    any help is appreciated 

    You can only forward traffic to a single IP address. Anything else is impossible. It would be like you talking to 10 persons at the same time... Total confusion...

  • Multiple input streams

    hey folks newbie here
    i am designing a client server program
    with my client i want to send serialized objects & primitive types across the socket to the server
    is it possible to creat two output streams on the same socket i.e an ObjectOutputStream & a DataOutputStream on the same socket, i have tried this but get some errors so i don't think this is possible
    if not possible how would i be able to send both primitive types & serialized objects across the same socket

    Forget about the first person's post. He his correct, but it is not the solution used by most developers.
    Multiple Input Streams/Output Streams are easy to create. A better "management" deal would be like FTP - FTP uses two port, one for data and one for commands.
    Socket objectSocket = new Socket("www.object-server.com", objectPort);
    Socket dataSocket = new Socket("www.data-server.com", dataPort);
    The server should implement a class which represents the connection of both sockets as a single client. Somethig like this:
    public class Connection {
        Socket dataSocket;
        Socket objectSocket;
        public Connection(Socket s1) {
            dataSocket = s1;
        public void addObjectSocket(Socket s2) {
            objectSocket = s2;
    }You can then use this class (permission given to copy and use without license hereby granted) to manage the task.
    There are also many other ways of doing this. You can also apply multiple i/o streams to the same socket - but your server/client needs to know which data type is being sent or to which stream the data needs to be read from.
    Example: Client sends binary file to server (such as FTP)
    ObjectOutputStream out = new ObjectOutputStream(socket.getOutputStream());
    PrintWriter out2 = new PrintWriter(socket.getOutputStream());
    The code above will work, but data send in one stream will not show up in the other stream. The server does the reverse for the input > adding different InputStreams to the socket, but when data is sent from the client's object stream both of the server's streams (BufferedReader or other text-based input) and the object stream will receieve the file, so you need to communicate between the client and server which stream to read from/write to.
    Client: Send file via socket to server by means of ObjectOutputStream
    Note: You should not need to implement the try-catch logic when passing the argument of the socket - since it would throw that in the class which was calling the constructor, but you CAN implement it here as long as it is not handled in the calling class. If you do, the complier should throw an error saying that the exception would not be thrown at this point.

  • How To Install Multiple OBIEE Instances On One Linux Machine

    Hi,
    OS: Red Hat ES 5.2
    OBIEE : 10.1.3.4
    We one development server(Linux) where one OBIEE 10.1.3.4 was installed with os user as 'ora1a' (Deployed on Oracle Application Server 10.1.3.4)
    and now I have installed OBIEE 10.1.3.4 on same Linux Server with different user(ora2b) and different mount point (Deployed on Another Oracle Application Server 10.1.3.4 )
    But My OBIEE was not working and I came to know that only one can be working by default.
    After following few notes i have update NQSConfig.inc and odbc.ini with different ports ie from 9704 to 9725 and bounced BI server and presentation server
    But still its not working can any one tell me what are all needs to update to make it work
    Thanks in advance
    Regards,
    Bhanu Chander
    Reference's i used: HOW TO: Install Multiple OBIEE Instances On One UNIX Machine          (Doc ID 605582.1)

    Hi
    I was not much clear about what you are telling
    See my first OBIEE instance URL is http://hostname18.oracle.com:7777/analytics (As i deployed OBIEE on Application server 10g(OAS1))
    and second one is http://hostname18.oracle.com:7778/analytics (As i deployed OBIEE on another Application server 10g(OAS2))
    Also My port for first OBIEE instance is 9704 and second one is 9725(Which i changed to this)
    Now tell me what are all i should update
    Thanks,
    Bhanu Chander

  • Multiple users logged into one server, each users printer has a different name, application needs ONE name to print to.

    Multiple users logged into one server, each users printer has a different name, application needs ONE name to print to. 
    I'm NOT in any way a Terminal Services expert and I need help trying to get an application program working in a multi-user environment.
    The issue is that the printer changes for every user that is logged in. The application needs to print NOT to the default printer, but to a "special" printer which is selected in the application... let's call it a label printer to simplify the explanation.
    You have your default regular printer, easy for the application to find that one, and then you have a special printer that labels get printed onto. The application needs to know what printer is the label printer. So we allow the user to select that in the
    application and the selection is stored in a config file in 
    C:\ProgramData\mfgr\prog\setting files
    I don't have access to the application so I can't change how this works.  
    In the "regular" world, selecting the label printer driver to use should be per machine, NOT per user. When a new user logs into a machine, the physical printer doesn't go "poof" and a new printer suddenly appear. Same printer for all
    users.
    Yet in terminal services, the physical machine is "merged" with the virtual machine on the server. And there can be many users logged in at the same time. So each users real machine (and real printer) is injected into the "fake" terminal
    services machine. The name of the printers is made unique for each user. So the printers DO go "poof" and change names depending on the user logged into terminal services.
    So user "A" logs in and sets up the application to print to "LabelPrinterForUserA" (or whatever the name of the printer happens to be), that setting is stored in the ProgramData subfolder, and all is well. Later, user "B" logs
    in, and when they print, the application tries to print to "LabelPrinterForUserA" which doesn't exist for user B or is only accessible by user A. If user B re-configures, that breaks it for user A. 
    SOLUTION 1: The way that /should/ work (in my mind) is that you define one "generic" printer in Terminal Services... call it "Virtual Label printer" and when the user wants to print to it, the print job gets re-directed back to whatever
    physical printer is actually connected to their local workstation. There is a map of virtual printer to actual printer depending on the current user. The application is told once to print to "Virtual Label Printer" for all users.
    SOLUTION 2: Or... there should be some way to make the ProgramData sub folders separate per user. E.g. when user "A" tries to access:
    C:\ProgramData\mfgr\prog\setting files
    they actually get 
    C:\UserData\UserA\AppData\mfgr\prog\setting files
    and user "B" gets
    C:\UserData\UserB\AppData\mfgr\prog\setting files
    So the question I have is: Does either of those solutions exist hidden somewhere in the setup of terminal server? Or is there another way around this issue that I don't know?

    I don't really have a "for sure" answer to this, but because people here can't seem to deal with a question that hasn't been answered I'll provide the best answer I did receive from ServerFault.com user Nathan:
    I can feel your pain with using old software on terminal servers ...the solution I've come up with definitely won't scale as it requires some manual configuration, but I've gotten this method to work with our label printers (which require to be
    printed to an LPT port...yep, that old).
    Share your USB-connected printers to the network on each machine. Then, have the user log in on aunique session for each of them
    (a TS account cannot be shared among computers for this to work) and install a network printer pointing to the USB one they shared. Try to use a DNS name to account for possible DHCP movements.
    After, it should work. Each user can do this since display names can be identical as long as the ports are different (which they are).
    This was clarified by the following series of comments:
    I think you are on to something here, and I originally advised the admin to do this. The problem he ran into is that it setup the printer names in the TS as "printer on usersworkstation"
    and he could not rename it except to change the "printer" to whatever. E.g. the "on userworkstation" remained. I believe there is another way of installing the printer which avoids this, but I can't find it. Ages ago, one used to do NET
    USE LPT2 \\computer\printer password /USER:domain\user /PERSISTENT:YES and then tell the driver to print to LPT2 –  James
    Newton Mar
    17 at 16:21   
    @JamesNewton That's actually the exact method we used. The way around the "network printer" part is to install it as local printer and map it to a TCP/IP port that way. –  Nathan
    C Mar
    17 at 16:28
    You mean in the case where the printers are TCP/IP connected and not local USB / LPT to the users workstation? That makes sense. Wonder if this will work for USB connected printers... –  James
    NewtonMar
    17 at 16:35   
    @JamesNewton You'd share the local printer on the client's PC then on the server connect via TCP/IP to it. You'd need static addresses or use DNS names if DHCP, though. –  Nathan
    C Mar
    17 at 16:51
    Ah. Yes. I see. Looks like the LPT thing should work even with a USB connected printer:superuser.com/questions/182655/… –  James
    Newton Mar
    17 at 17:09   

  • Can I set up multiple usb hard drives- one for time machine and a second for media? Can one also print wirelessly with an old HP C6280 printer?

    Can I set up multiple usb hard drives- one for time machine and a second for media?
    Can one also print wirelessly with an old HP C6280 printer?

    Can I set up multiple usb hard drives- one for time machine and a second for media?
    Yes.
    Can one also print wirelessly with an old HP C6280 printer?
    Possibly by using an Airport Express, but depends on what type of port connection the printer requires.

  • Can you have two seperate acounts on one MAC and if so how do you do it?

    Can you have two seperate acounts on one MAC and if so how do you do it?

    Look at Method One in this document:  How to use multiple iPods, iPads, or iPhones with one computer, http://support.apple.com/kb/HT1495

  • Creating multiple http servers on one machine

    I created multiple http servers on one machine.
    I did this in the following way:
    Created a http service as nt service with the following command:
    apache -i -n Testservice -f d:\oracle\isuites\apache\apache\conf\httpd2.conf.
    When I start the service, I always get an error:
    Didn't return an error. Cannot start service.
    Can someone help me.
    I need two httpd services as nt service. Because, I want to use oracle fail safe. So I need a service.
    Alternative : I can create batch files. But I want to start these batch files as nt service. Is there a possibility on
    Windows nt to do this, or an available tool.
    Thanks in advance,
    Iloon

              "Jason Rosenberg" <[email protected]> wrote:
              >Hello,
              >
              >I am wondering about having multiple servers on one machine.
              >I take it, each server will require a unique ip address, which can
              >be done either by using multiple NIC's or using multi-homing.
              If you want to have multiplie servers in the same machine and you want to cluster them then you need ip for each instance.
              If you want multiple instances without clustering, then you can have them run on the same ip but each one should have a different port.
              >
              >I am asking because I am wondering whether it will always be valid
              >for me in servlet code to identify my current server instance by
              >ip address (InetAddress). Or is there a better way to do this?
              If you are accessing the ejb/services on the same server using a servlet. You can get the context, simply using the default getInitialContext(). This should return the context to the local machine. This shoudnt require any ip information.
              >
              >Jason
              >
              >
              

  • Home Theater need. Multiple Audio Streams from 1 card or possible to use 2 car

    I currently have 2 SB Li've's installed and a SB Audigy in the box.
    I would like to be able to send different audio out to different devices. I need to send audio from a game interface called MAME 32 to a speaker system connected to the PC. I also use this PC as a home theater PC and want to send audio from my DVD playing software out to my TV(in analog stereo mode) and/or to my receiver(in Dolby Digital mode using the digital connector).
    I would like to be able to run these seperatly without having to go into the Control Panel and switch the default sound card like I am doing now. I do not need to run them at the same time.

    Bummer. Are you guys working on something that might have this capability? Seems to me that the closer we integrate PC's into our entertainment systems the more need we will have for the ability to do multiple audio streams, i.e. MP3's to the living room. DVD movie audio to the family room, XM radio classical station to the kitchen for mom etc..
    Intel is offering this as an onboard solution that has the ability to do at least 2 different streams.
    http://www.intel.com/design/chipsets/hdaudio.htmMessage Edited by relay on 0-26-2004 05:02 PM

Maybe you are looking for

  • HT3777 Leopard 10.6.8  with Boot Camp 3 do not support Windows XP SP2???

    Hello! I have my MacBook Pro with Leopard 10.6.8 with Boot Camp 3 on it.Reading a BOOT CAM article I could see that it supports Windows XP SP2.I just installed Windows XP SP2...and when I am trying to use the drivers from MAC DVD it says that BOOT CA

  • Repository Content server

    We are not sure that are documents are stored in the content server. Is there any way to check this? because when we want to change a document with transaction cv02n you see a document and when you try to open it it gives the message "file c:\temp\_d

  • Title window

    To the dev. people! Here is one thing I for every new version is wondering why it is never getting the way I want it to be. If I have for an example a project that have 10 titles. Every single time I open that title tool window it have rezised the fi

  • Migrating Access Database to Web WITH FORMS (not just backend)

    How difficult would this be, what steps would be involved and is Dreamweaver capable of helping? The server uses IIS and ASP so compatibility should be fine with access. I have enough of a programming history to replace vbasic code with ASP code if I

  • Program SAP_DEMO_PICTURE

    Hi,   In the program SAP_DEMO_PICTURE 2 pictures are being displayed. Where are those pictures stored? How to upload new pictures which I can use that way? Thanks, Anupam