Transmit and receive from the same ip address?

Helpers:
We 've been using transmit/Receive for a while, I read all the discussions. No one seem really know does the transmit send to a destination IP address and the destination receive from the same IP or the IP address the sender send from?
like sender send from: java Transmitter 123.4.3.162 5000
receiver receive from: java Receive 123.4.3.162 5000
or sender send from: java Transmitter 123.4.3.162 5000
receiver receive from: java Receive 10.118.5.162 5000
I think the frist one is correct, does anyone has clear idea and experience about it.
Desperate coder!

Receiver code is as follows
import java.io.*;
import java.awt.*;
import java.net.*;
import java.awt.event.*;
import java.util.Vector;
import javax.media.*;
import javax.media.rtp.*;
import javax.media.rtp.event.*;
import javax.media.rtp.rtcp.*;
import javax.media.protocol.*;
import javax.media.protocol.DataSource;
import javax.media.format.AudioFormat;
import javax.media.format.VideoFormat;
import javax.media.Format;
import javax.media.format.FormatChangeEvent;
import javax.media.control.BufferControl;
public class AVReceive2 implements ReceiveStreamListener, SessionListener,ControllerListener
String sessions[] = null;
RTPManager mgrs[] = null;
Vector playerWindows = null;
boolean dataReceived = false;
Object dataSync = new Object();
public AVReceive2(String sessions[])
          this.sessions = sessions;
protected boolean initialize()
try
          InetAddress ipAddr;
     SessionAddress localAddr = new SessionAddress();
          SessionAddress destAddr;
          mgrs = new RTPManager[sessions.length];
          playerWindows = new Vector();
          SessionLabel session;
          for (int i = 0; i < sessions.length; i++)
               try
     session = new SessionLabel(sessions);
          catch (IllegalArgumentException e)
     System.err.println("Failed to parse the session address given: " + sessions[i]);
                    return false;
System.err.println(" - Open RTP session for: addr: " + session.addr + " port: " + session.port + " ttl: " + session.ttl);
     mgrs[i] = (RTPManager) RTPManager.newInstance();
     mgrs[i].addSessionListener(this);
     mgrs[i].addReceiveStreamListener(this);
     ipAddr = InetAddress.getByName(session.addr);
          if( ipAddr.isMulticastAddress())
// local and remote address pairs are identical:
localAddr= new SessionAddress( ipAddr,session.port,session.ttl);
destAddr = new SessionAddress( ipAddr,session.port,session.ttl);
                    else
localAddr= new SessionAddress( InetAddress.getLocalHost(),session.port);
destAddr = new SessionAddress( ipAddr, session.port);
          mgrs[i].initialize( localAddr);
BufferControl bc = (BufferControl)mgrs[i].getControl("javax.media.control.BufferControl");
                    if (bc != null)
          bc.setBufferLength(350);
               mgrs[i].addTarget(destAddr);
          catch (Exception e)
System.err.println("Cannot create the RTP Session: " + e.getMessage());
return false;
     long then = System.currentTimeMillis();
long waitingPeriod = 30000; // wait for a maximum of 30 secs.
          try
          synchronized (dataSync)
while (!dataReceived && System.currentTimeMillis() - then < waitingPeriod)
                    if (!dataReceived)
                              System.err.println(" - Waiting for RTP data to arrive...");
                    dataSync.wait(1000);
          catch (Exception e) {}
          if (!dataReceived)
System.err.println("No RTP data was received.");
          close();
          return false;
return true;
public boolean isDone()
          return playerWindows.size() == 0;
protected void close()
          for (int i = 0; i < playerWindows.size(); i++)
          try
     ((PlayerWindow)playerWindows.elementAt(i)).close();
          catch (Exception e) {}
          playerWindows.removeAllElements();
     // close the RTP session.
          for (int i = 0; i < mgrs.length; i++)
          if (mgrs[i] != null)
mgrs[i].removeTargets( "Closing session from AVReceive2");
mgrs[i].dispose();
                    mgrs[i] = null;
PlayerWindow find(Player p)
          for (int i = 0; i < playerWindows.size(); i++)
          PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
          if (pw.player == p)
                    return pw;
          return null;
PlayerWindow find(ReceiveStream strm)
          for (int i = 0; i < playerWindows.size(); i++)
          PlayerWindow pw = (PlayerWindow)playerWindows.elementAt(i);
          if (pw.stream == strm)
                    return pw;
          return null;
public synchronized void update(SessionEvent evt)
          if (evt instanceof NewParticipantEvent)
     Participant p = ((NewParticipantEvent)evt).getParticipant();
System.err.println(" - A new participant had just joined: " + p.getCNAME());
public synchronized void update( ReceiveStreamEvent evt)
     RTPManager mgr = (RTPManager)evt.getSource();
Participant participant = evt.getParticipant();     // could be null.
ReceiveStream stream = evt.getReceiveStream(); // could be null.
          if (evt instanceof RemotePayloadChangeEvent)
System.err.println(" - Received an RTP PayloadChangeEvent.");
System.err.println("Sorry, cannot handle payload change.");
          System.exit(0);
          else
          if (evt instanceof NewReceiveStreamEvent)
          try {
stream = ((NewReceiveStreamEvent)evt).getReceiveStream();
DataSource ds = stream.getDataSource();
          // Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
                    if (ctl != null)
System.err.println(" - Recevied new RTP stream: " + ctl.getFormat());
                    else
System.err.println(" - Recevied new RTP stream");
                    if (participant == null)
System.err.println(" The sender of this stream had yet to be identified.");
                    else
System.err.println(" The stream comes from: " + participant.getCNAME());
// create a player by passing datasource to the Media Manager
Player p = javax.media.Manager.createPlayer(ds);
                    if (p == null)
                    return;
               p.addControllerListener(this);
                    p.realize();
     PlayerWindow pw = new PlayerWindow(p, stream);
     playerWindows.addElement(pw);
               synchronized (dataSync)
                    dataReceived = true;
                    dataSync.notifyAll();
          catch (Exception e)
     System.err.println("NewReceiveStreamEvent exception " + e.getMessage());
                    return;
          else
          if (evt instanceof StreamMappedEvent)
               if (stream != null && stream.getDataSource() != null)
                    DataSource ds = stream.getDataSource();
          // Find out the formats.
RTPControl ctl = (RTPControl)ds.getControl("javax.media.rtp.RTPControl");
     System.err.println(" - The previously unidentified stream ");
                    if (ctl != null)
     System.err.println(" " + ctl.getFormat());
     System.err.println(" had now been identified as sent by: " + participant.getCNAME());
          else
          if (evt instanceof ByeEvent)
System.err.println(" - Got \"bye\" from: " + participant.getCNAME());
          PlayerWindow pw = find(stream);
          if (pw != null)
                    pw.close();
          playerWindows.removeElement(pw);
public synchronized void controllerUpdate(ControllerEvent ce)
          Player p = (Player)ce.getSourceController();
          if (p == null)
          return;
     // Get this when the internal players are realized.
          if (ce instanceof RealizeCompleteEvent)
          PlayerWindow pw = find(p);
          if (pw == null)
          // Some strange happened.
          System.err.println("Internal error!");
                    System.exit(-1);
          pw.initialize();
          pw.setVisible(true);
          p.start();
          if (ce instanceof ControllerErrorEvent)
          p.removeControllerListener(this);
          PlayerWindow pw = find(p);
          if (pw != null)
                    pw.close();
          playerWindows.removeElement(pw);
     System.err.println("AVReceive2 internal error: " + ce);
class SessionLabel
          public String addr = null;
          public int port;
          public int ttl = 1;
SessionLabel(String session) throws IllegalArgumentException
          int off;
          String portStr = null, ttlStr = null;
          if (session != null && session.length() > 0)
     while (session.length() > 1 && session.charAt(0) == '/')
          session = session.substring(1);
          // Now see if there's a addr specified.
                    off = session.indexOf('/');
                    if (off == -1)
                    if (!session.equals(""))
               addr = session;
                    else
          addr = session.substring(0, off);
          session = session.substring(off + 1);
          // Now see if there's a port specified
          off = session.indexOf('/');
                    if (off == -1)
                    if (!session.equals(""))
                    portStr = session;
                         else
          portStr = session.substring(0, off);
          session = session.substring(off + 1);
          // Now see if there's a ttl specified
                              off = session.indexOf('/');
                              if (off == -1)
                              if (!session.equals(""))
                                        ttlStr = session;
               else
          ttlStr = session.substring(0, off);
          if (addr == null)
     throw new IllegalArgumentException();
          if (portStr != null)
                    try {
          Integer integer = Integer.valueOf(portStr);
                    if (integer != null)
                              port = integer.intValue();
          catch (Throwable t)
          throw new IllegalArgumentException();
          else
          throw new IllegalArgumentException();
          if (ttlStr != null)
                    try {
          Integer integer = Integer.valueOf(ttlStr);
                    if (integer != null)
               ttl = integer.intValue();
                    catch (Throwable t)
          throw new IllegalArgumentException();
class PlayerWindow extends Frame {
     Player player;
     ReceiveStream stream;
     PlayerWindow(Player p, ReceiveStream strm) {
     player = p;
     stream = strm;
     public void initialize() {
     add(new PlayerPanel(player));
     public void close() {
     player.close();
     setVisible(false);
     dispose();
     public void addNotify() {
     super.addNotify();
     pack();
class PlayerPanel extends Panel {
     Component vc, cc;
     PlayerPanel(Player p) {
     setLayout(new BorderLayout());
     if ((vc = p.getVisualComponent()) != null)
          add("Center", vc);
     if ((cc = p.getControlPanelComponent()) != null)
          add("South", cc);
     public Dimension getPreferredSize() {
     int w = 0, h = 0;
     if (vc != null) {
          Dimension size = vc.getPreferredSize();
          w = size.width;
          h = size.height;
     if (cc != null) {
          Dimension size = cc.getPreferredSize();
          if (w == 0)
          w = size.width;
          h += size.height;
     if (w < 160)
          w = 160;
     return new Dimension(w, h);
public static void main(String args[])
          String[] argv = new String[2];
          argv[0] = "100.210.0.220/42050";
          argv[1] = "100.210.0.220/4002";
          AVReceive2 avReceive = new AVReceive2(argv);
          if (!avReceive.initialize())
     System.err.println("Failed to initialize the sessions.");
          System.exit(-1);
          try {
          while (!avReceive.isDone())
                    Thread.sleep(1000);
          } catch (Exception e) {}
          System.err.println("Exiting AVReceive2");

Similar Messages

  • My wife and I share the same email address and Apple ID.  We are not able to send and receive Text Messages to one another.

    My wife and I share the same email address and Apple ID. We are not able to send and receive Text Messages to one another. Is the cause of this because we share the same Apple ID? Will we have to set up 2 separate primary email addresses to be able to  send and receive Tex Messages to one another? Like I said, we share the same email address and woul like to keep it that way to keep up with our email together. Is there a way to by-pass having to set up 2 primary emaill addresses if this is the problem?
    Thanks.

    go to the settings and turn off imessage
    but that don't change the issue that you will never be able to facetime eachtoher
    the appleID is really meant as the handle that identify you it was not meant to be shared
    but can see that people may want to do not buy apps more then once

  • How could I play and transmit a stream from the same camera

    How could I play and transmit a stream from the same camera?

    Hi,
    As I said, you can use the method getVisualComponent() of the Processor to get a preview Window.
    You create a Processor, prepare it to generate an appropriate output DataSource for what you want to do (saving, TXing, etc).
    Then, for this Processor you extract an AWT Component where the stream will be previewed using the method getVisualComponent().
    Some of the player examples in the JMF guide use this technique. I'm still not write my own player. I'm using an adaptation of the RTPPlayer, but I'm planning to use the above technique to create a Player where I can apply some effects to the stream and then save it if the user wants to.
    If someone already did that, please, correct me if my procedure isn't right!
    By the way, thanks for your help! I was using the DataSource returned from Manager.createCloneableDataSource only to create the clones. I was feeding my main Processor with the original DataSource. That was the problem!
    RGB

  • My husband and I share the same email address. Is there someway to have different AppleIDs with the same email address?

    My husband and I share the same email address at home. Is there some way creating an Apple ID using the same email address? We have multiple apple devices at home (2x iphone4, imac, mini ipad, and notebook) and want our emails from that one address to come through on the different devices.

    No, you cannot have the same primary email address used for two separate Apple IDs.
    However, you can sign into the same email address on your separate devices for the purposes of receiving mail.  Go to Settings > Mail, Contacts & Calendars > Add Account.
    Apple IDs are for using Apple services, like the App Store, iTunes, etc.
    Email addresses (while used as the NAME of an Apple ID), are separate entities.

  • Since iOS6, whenever I send an iMessage to my wife, it sends the message to me too.  How do I stop this? My wife and I share the same email address.

    Since iOS6, whenever I send an iMessage to my wife, it sends the message to me too.  How do I stop this? My wife and I share the same email address.

    On at least one of the phones, go to Settings/ Messages/ Send & Receive and then tap the e-mail address to turn that option off.  That should force the iMessage to be sent to the unique phone numbers of the phones, not the e-mail address that is common between the phones.
    Or alternatively, create a new e-mail address for one of you and select that as the e-mail option to receive at on one of the phones instead of the shared e-mail.

  • Can I stream and sync from the same itunes library to one AppleTV?

    Can I stream and sync from the same itunes library to one AppleTV?

    From what I can tell this is a bug.
    A very Frustrating bug. When the take 2 update launched I was streaming movies via "shared movies" from my synched computer without any issues. However after a couple of recent iTunes updates all the "shared" menus stopped appearing and I can no longer stream anything from my main computer.
    When I open up my macbook though everything streams fine, all the "shared" menus immediately appear.
    Numerous restarts, factory resets and reinstalling the 2.0 software have done nothing to help this issue.
    If anyone has any more light on the subject it'd be great to hear. Also I'm not sure which update broke it because I went about a month not using the apple tv.

  • HT201493 My Wife and I share the same email address but each has an IPhone. We would like to have both of us individually on find friends but cannot do it via the email route. how is it done?

    My wife and I share the same email address but have separate IPhones. We would like to have each phone individually on "find friends" but cannot do it via email route. How is it done?

    make seperate appleID's if you wish to be frinds or if you wish to facetime video chat and if you wish to not recieve the samme imessage msg's unless you turn it off
    you can still set both your iphones to use an email address even if both have different appleId's
    the appleID is a handle not a link to an email address

  • Is it possible to sync AND stream from the same iTunes library?

    Hi,
    I am having trouble in setting up sync AND stream from the same iTunes library.
    Config :
    Mac OS - Latest update 5/6/09
    iTunes - Latest update 5/6/09
    Apple TV - Latest update 5/6/09
    I am able to either sync OR Stream from my iTunes library but not sync AND stream from the same iTunes library
    Let's say i want to sync :
    Go to Apple TV > Settings > computer
    Add Library (Not shared for Syncing)
    Enter passcode in iTunes and select the items to sync
    After sync is complete
    You can see photo, music & video in My Photos, My Music & My Videos.
    Let's say now my Apple TV is full
    So like to stream some other content
    Now
    Go to Apple TV > Settings > computer
    Add SHARED Library
    Passcode is shown in apple TV but not able to Enter it in iTunes (click to set link is not there next to Apple TV item under devices)
    To get that you have to right click the apple tv from the devices and select don't sync.
    You will get a message saying that all content in apple TV will get deleted.
    If you say yes then only the passcode screen for streaming is presented.
    So i am not able to sync AND stream from the same iTunes library.
    Any idea?

    macanandapple wrote:
    1. The checkbox for "show only synced content" should be unchecked
    yes
    2. No need to Add Shared Library
    correct
    3. After syncing is complete as per the steps said before, if i have to see a synced content i go to My Movies for streamed content i have to go to Shared Movies?
    no... both synced and streamed content show up all together. there is no way to tell what content is synced or streamed when looking at it on the appletv. it is seemless as in there is no difference in how it is presented.
    you also need to make sure you are using "custom sync" rather than "automatic sync", as you can't select the "show only synced content" box when using "automatic sync".

  • MY HUSBAND AND I SHARED THE SAME EMAIL ADDRESS, AT THAT TIME I PURCHASED MUSIC, NOW I HAVE MY  OWN EMAIL. I ADDED MYSELF TO THE ORIGINAL EMAIL, ON THE ORIGINAL ITUNES ACCOUNT. HOW CAN I GET MY MUSIC ON MY I PHONE. MY HUSBAND HAS ALL MY MUSIC ON HIS PHONE.

    MY HUSBAND AND I SHARED THE SAME EMAIL ADDRESS, AT THAT TIME I HAD DOWNLOADED MUSIC TO MY PHONE. I GOT MY OWN EMAIL ADDRESS AND ADDED THAT EMAIL TO THE ORIGINAL ACCOUNT, WHICH ORIGINATED WITH MY HUSBANDS EMAIL.
    HOW CAN I GET THE MUSIC DOWNLOADED TO MY IPHONE.

    nshepley wrote:
    I GOT MY OWN EMAIL ADDRESS AND ADDED THAT EMAIL TO THE ORIGINAL ACCOUNT, WHICH ORIGINATED WITH MY HUSBANDS EMAIL.
    Please turn off your CAPS LOCK!
    How did you "add that email to the original account"?
    You changed the AppleID to your new email address?

  • HT204407 My wife and I share the same email address but have different iphone numbers.  Is there anyway we can both be on "Find Friends."

    My wife and I share the same email address but have different iphone numbers.  Is there anyway we can both us "Find Friends" apps?  When I try to enter her contact name it won't allow me to do this.  Thanks.

    make seperate appleID's if you wish to be frinds or if you wish to facetime video chat and if you wish to not recieve the samme imessage msg's unless you turn it off
    you can still set both your iphones to use an email address even if both have different appleId's
    the appleID is a handle not a link to an email address

  • What is the best way to have access to OSX and OS9 from the same machine?

    What is the best way to have access to OSX and OS9 from the same machine?
    Do I need to partition the hard drive? Installed both Tiger and OS 9 on the G5 and it is having problems starting up properly.
    G5   Mac OS X (10.4)  

    And here is the prove for Edwin's message: Macintosh: Some Computers Only Start Up in Mac OS X

  • Hello..Does anyone in this community know what the following error code indicates   0x8002006E   I was trying to burn a DVD from files in a burn folder. They were pictures from my Nikon camera. I can play videos and movies from the same dvd player.

    I was trying to burn a DVD from files in a burn folder. They were pictures from my Nikon camera. I can play videos and movies from the same dvd player.    Thanks for any help you can offer,

    Thanks for your reply:
    I did find an error log related to the error code and tried all suggestions on the list of recommendations, still no luck            
    I definitely am running OS X10.5.8 (hopefully will be updating later on this month)
    I tried several brand new discs from the same box, still no luck.
    My last option is to go out and try a different brand, guess I'll go with Verbatim this time but I think I'll poke around some more before buying 20 more new discs.

  • Can my ipad and computer have the same IP address?

    Can my ipad and computer have the same IP address?

    No they cannot. Each device must have a unique LAN IP address.

  • LAN and WAN share the same MAC address -- could this be a security issue?

    When I bought the AEBS(n), I was a bit surprised to see only one ethernet MAC address listed (on bottom of unit, or was it in config utility?), in addition to wireless MAC. My main router has two ethernet MACs.
    So last nite, I investigated. I confirmed my suspicion that both the WAN port and the LAN ports share the same MAC address! My setup has the AEBS WAN port plugged into my home LAN's main router, and a Linux machine plugged into a LAN port of the AEBS.
    View of AEBS WAN side (from main router at 192.168.1.1)
    ii# arp
    Seconds IP Address MAC Address
    734 66.130.224.1 001120A87AF5 -- ISP router
    789 192.168.1.21 0016CBC430A6 -- AEBS WAN port
    28 192.168.1.33 0010DC47DC53 -- home PC
    824 192.168.1.73 00065BB2F295 -- work PC
    View of AEBS LAN side (from a Linux box at 10.0.1.41)
    root@LKG7CAE25 # cat /proc/net/arp
    IP address HW type Flags HW address Mask Device
    10.0.1.1 0x1 0x2 00:16:CB:C4:30:A6 * eth0
    10.0.1.1 on the LAN side of AEBS and 192.168.1.21 on the WAN side of the AEBS both use the same MAC address, 00:16:CB:C4:30:A6.
    I tried to provoke some leakage between the two sides (for example with broadcast packets), but haven't been able to do it so yet. Perhaps the switch in front of the eth MAC has enough smarts to keep the two subnets separate? Still it sort of worries me, if I used the AEBS as my only router, that both WAN and LAN go thru the same ethernet MAC (same h/w). I browsed here but found no discussion on this.
    Comments anyone?

    .... This is why there are separate MAC addresses
    for ethernet and wireless, they are physically
    different networks. In the case of the WAN/LAN, both
    are ethernet-type networks but are physically
    distinct (this is the purpose of a router like the
    AEBS), so having the same MAC address on both sides
    won't cause any sort of collision nor should it be
    possible to leak across networks. MAC addresses can't
    be used for routing beyond the physical network.
    If it is indeed two different NICs sharing a single MAC, then indeed it is not an issue as you would never want to connect these two NICs together. But is it really two NICs?
    My worry is that these two subnets are on the same physical network, with some magic going on to keep them separate anyway. Do we have some picture of AEBS internals? Maybe that would answer the question...

  • My iphone and desktop have the same ip address, new ipad comes up different. Ipad data usage very high. All use the same Linksys router

    My  two iPhone4, Vista PC desktop, Gateway XP desktop and Dell XP portable all have the same IP address. New iPad2 comes up with a different one and seems to eat data from AT&T. All share the same residential router. Shouldn't the  iPad  IP be the same as the others?
    Thanks.
    Befuddled new iPad guy.

    Excuse again. Wrong info. Router # comes up same for all units.
    IP addreses are same except for last digit. As< I think it should be.
    Think I will visit the Apple store.
    Forget it, sorry to bother you. Fail.

Maybe you are looking for

  • Key figure Period Value TC has a difference of 123,445- IDR in roundingstep

    Hi, Pls suggest some tips, to resolve this, as I am struck in Currency Translation; Diagnosis While checking the rounding conditions for key figure Period Value TC a difference of 123,445- IDR was found in step Balance Sheet. System Response The data

  • Can't join wi-fi at home

    Wi-fi works but not at my house. I know wi-fi is working because I use it to send signal to my tv to watch internet based channels.

  • Upgrade from Tiger (client) to Leopard Server

    Hi all, I have a client with an existing dual G5 box they have running Tiger. They use it as a file share primarily but want the extra functionality of the server OS (viz Leopard server). Is there an upgrade path from OS 10.4 client to 10.5 server or

  • Code completion user commands helplink

    Hello I am currently working on code completion for user commands in version 2012.  I have an XML file in which I have the descriptions for all the hover text and associated help links.  Everything is working correctly except for the help links.  The

  • IPhoto images reverting spontaneously (edits lost)

    I'm not sure if I'm following protocol here. I started a discussion about "iPhoto Library Locked" and in attempting to solve the problem realized I have a different problem. I'm going to go ahead and post under the new heading in the hopes that it wi