aspose file tools*
The moose likes Java in General and the fly likes can we streaming the A/V on the same machine? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "can we streaming the A/V on the same machine?" Watch "can we streaming the A/V on the same machine?" New topic
Author

can we streaming the A/V on the same machine?

saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
i am trying to develop a server and client for video stream using RTPS, now the problem is i am working on a stand-alone machine,
now i can transmitt the data from the server but when i make my client to listen to the same port where my server is transmitting the data an error is raised stating that

and my client is working properly when i invoke it first it will be checking for the server transmitting in the particular port but i can't start the server now, once again the same problem.

i know that it is the problem with port which can't be used once it has been bind, but i am working in a stand alone system, any solutions for this.
Christian Dillinger
Ranch Hand

Joined: Jul 20, 2009
Posts: 189
Why do you want to bind both client and server to the same port?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
Well, client and server *must* use the same port, otherwise they won't be able to talk to each other. But there can only be a single server port, and it sounds as if the server isn't fully shut down when you try to restart it.


Ping & DNS - my free Android networking tools app
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
i am using a stand-alone system which is not on a network
Christian Dillinger
Ranch Hand

Joined: Jul 20, 2009
Posts: 189
No, they don't have to use the same port... If he wants to stream from server to client why should the client be listening on any port? Why does he want to open a socket and listen on the client side? It seems as if he wants to add some server-stuff to the client-side.
If I open run a webserver on my local machine my browser can still access other webservers because there is no need that the client uses port 80 on the local side.
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
see my server(a java class) will start streaming a file using using RTSP and will specify the destination ip and port on to which i want to transmit
the client(again a java class) will be listening to the same port which the server specified to receive the data.

here my class will split the video and audio into two separate tracks and transmit them such a way that the second channel(audio track) will be streaming on a port that will be incremented by 2
so
port 5000 -> video track
port 5002 -> audio track

now on the client i have to listen to the two port simultaneously to receive the video and audio as well.



but couldn't do so stating that it is being bind already, i know this will happen but any solution to over come this
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41906
    
  63
Christian Dillinger wrote:If I open run a webserver on my local machine my browser can still access other webservers because there is no need that the client uses port 80 on the local side.

Ah, you're talking about the client's local port. I took the question to be about the client's remote port, which must obviously be the same as the server port.
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
can any one go through the issue i have raised
Christian Dillinger
Ranch Hand

Joined: Jul 20, 2009
Posts: 189
You cannot have two Socket listen to the same port on the same network interface. Why can't you let you client listen to port x and your server to y? Is it really necessary that your client opens a port and the server has to connect to it? Or can the client connect to the server?
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
Is it really necessary that your client opens a port and the server has to connect to it? Or can the client connect to the server?

i have the feasibility to do both
i can first run the server stream and can ask the client to listen to the port
or
i can first make the client to listen to a particular ports where it will be waiting for server to send the stream and once the server start the stream on the same port it will catch it.

is this the one you asked me or any thing else can you make it more clear
saipraneeth nallapareddy
Ranch Hand

Joined: Dec 02, 2009
Posts: 159
any one please solve this issue.
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19697
    
  20

PatienceIsAVirtue.


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18855
    
  40


Also, the question has been answered twice in this topic. Have the client connect to the server's port. Do not have the client bind the port -- as the server is already using it (see the Socket bind() and connect() method).

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38910
    
  23
Not a "beginning" topic. Moving thread.
 
jQuery in Action, 2nd edition
 
subject: can we streaming the A/V on the same machine?