Managing stream between java server and c client

Hi all
I'm working on a client/server application.
Client have been written in C
Server is in Java.
The client connect to the server, send a message (unknown size) and wait a response from the server.
The server on connection start a new thread. This thread try to read data from the socket, using a BufferedInputStream :
BufferedInputStream in = new BufferedInputStream(socket.getInputStream());
As far as I dont know the size of the incoming message, i use the folowing algorythme to read data :
    byte[] bytesLus = new byte[1000];
    byte[] tmpBytesLus;
    byte[] tousLesBytes;int nb;
    i = 0;
    tousLesBytes = new byte[0];
    Log.trace(sourceTag,"Lecture des premiers octets");
    nb=in.read(bytesLus,0,bytesLus.length);
    Log.trace(sourceTag,nb+"octets lus");
    while (nb>0){                                                     
        tmpBytesLus = new byte[i+nb];
        System.arraycopy(tousLesBytes,0,tmpBytesLus,0,tousLesBytes.length);
        System.arraycopy(bytesLus,0,tmpBytesLus,tousLesBytes.length,nb);
        tousLesBytes = tmpBytesLus;
        i = i+nb;
        bytesLus = new byte[1000];
        Log.trace(sourceTag,"nb octets lus : " + i);
        if (in.available()>0)
            nb=in.read(bytesLus,0,bytesLus.length);
        else
            nb=0;
This seemed (but only seemed - i will explain it later) to work fine :
the client send a 6300 bytes sized msg. Server receive it, treat it and send response back. and this at each try.
But when i change the log level of the server from TRACE to ERROR (wich have on consequence to accelerate the instruction Log.trace( ... ) the server doesn't work so fine !
On first try, everything is ok, but on second, client send the same 6300 bytes msg, but server consider receiving only 3000 !
After debbuging, i found why :
the reason is the use of :
if (in.available()>0)
If you are reading faster than the writer, there is a moment where the stream is in a blocking state for the reader. and in.available return the number of bytes you can read before blocking...
So my server consider that it reached the end of the message....
So, after this long introduction, here my question :
What is the best way to detect the end of a stream ?
Should I send a special character on the stream and decode it on server ?
Thank's for your advice.
Olivier

Generally, there are n ways of making sure an entire message of unknown size is recieved:
1. Include some kind of validation criteria at the beginning of the message : checksum, bytecount, etc.
2. Format the message such that the server can tell when the end is reached (subject to "line noise" problems)
3. Enable two-way communication between the client and server, so they can work it out as they go.
4. Use a pre-established protocol that handles all this for you
5. Close the stream after writing if you only have one message.
6. etc etc etc.

Similar Messages

  • Network bandwidth requirement between MDM server and MDM Clients

    The MDM Sizing document for 5.5 states that  'a network connection between MDM Servers and MDM clients should be at least 100 Mbps'. Is this true? This would preclude MDM being offered as a hosted service. I'm interested in MDM Catalogue for SRM, so the catalogue content managers would need the import and data manager clients.

    One factor I noticed, in our project...
    I would recommend a 4 GB RAM for someone who is working with Import Manager.
    As far as the Network connection goes, I am not sure what the requirements are.
    We have faced several issues when the end user's laptop are less than 2 GB.
    If someone is working with Image Manager, then I would recommend 4GB.
    For bulk imports, I would use Import Server.

  • Bluetooth communication  between J2SE server and J2ME client

    Hi everyone!
    I'm new here in this forum...
    I try to make a small project to my studies,
    My project will include J2SE server and J2ME client.
    I'm stuck in the step of finding the server with the wireless toolkit emulator.
    I found this issue in old subject: here
    I try the solution in reply 6 but I don't understand exactly who to define kvem.home, and I got this error:
    " You must define the system property "kvem.home" "
    maybe someone can help me and explain how to do that?
    thanks!

    Hello,
    I want to find out how this can be done, too. I tried with
    System.setProperty("kvem.home", "C:\\WTK2.5.2");but I get an error:
    java.lang.UnsatisfiedLinkError: com.sun.kvem.jsr082.impl.bluetooth.BluetoothController.setSystemProperty(Ljava/lang/String;Ljava/lang/String;)I included these files in the build path:
    c:\WTK2.5.2\wtklib\gcf-op.jar
    c:\WTK2.5.2\wtklib\kenv.zip
    c:\WTK2.5.2\wtklib\kvem.jar
    and I import com.sun.kvem.bluetooth.*;
    I'd appreciate any help.

  • Bluetooth simulation between J2SE server and J2ME client

    hi there,
    I have a working bluetooth client/server application (using BlueCove), with the server on a PC (the PC has bluetooth hardware) and the client on a mobile telephone.
    I wish to move the application to a bluetooth simulated environment, however.
    To simulate bluetooth between 2 mobiles, I could open 2 instances of the WTK simulator and the mobiles will find each other -- but this doesn't meet my needs. I wish to simulate the bluetooth environment between a J2SE server and a J2ME client.
    Can I do this using the wireless toolkit? Does anyone have other ideas?
    thanks,
    Manoj

    OK - I have the solution.
    My PC (server) code used BlueCove to talk to the bluetooth stack. The trick is to use Sun's own KVM packages. This creates a virtual bluetooth device on your machine, shared by the WTK emulator.
    Here's the server code:
    package com.encube;
    import java.awt.BorderLayout;
    import java.io.InputStream;
    import javax.microedition.io.Connector;
    import javax.microedition.io.StreamConnection;
    import javax.microedition.io.StreamConnectionNotifier;
    import javax.swing.JFrame;
    import javax.swing.JList;
    import javax.swing.JScrollPane;
    import javax.swing.JTextArea;
    import com.sun.kvem.bluetooth.BluetoothStateException;
    import com.sun.kvem.bluetooth.DiscoveryAgent;
    import com.sun.kvem.bluetooth.LocalDevice;
    public class Server {
         public static final String UUID_STRING = "A781FDBA229B486A8C21CEBD00000000";
         public static final String SERVICE_NAME = "BTCHATSVR";
         private StreamConnectionNotifier server;
         JFrame jframe;
         JTextArea textArea;
         public static void main(String[] args) {
              Server svr = new Server();
              svr.doWork();
         public void doWork() {
              this.jframe = new JFrame("BT Server");
              this.jframe.setLayout(new BorderLayout());
              this.textArea = new JTextArea(6, 20);
              JScrollPane jsp = new JScrollPane(this.textArea);
              this.jframe.add(jsp, BorderLayout.CENTER);
              this.jframe.pack();
              this.jframe.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
              this.jframe.setVisible(true);
              startServer();
         public void logMessage(String message) {
              this.textArea.setText(this.textArea.getText() + message + "\n");
              this.textArea.setCaretPosition(this.textArea.getText().length());
         public void startServer() {
              LocalDevice local;
              try {
                   local = LocalDevice.getLocalDevice();
                   local.setDiscoverable(DiscoveryAgent.GIAC);
                   this.logMessage("max of "
                             + LocalDevice
                                       .getProperty("bluetooth.connected.devices.max")
                             + " connection(s) supported");
                   String url = "btspp://localhost:" + UUID_STRING + ";name="
                             + SERVICE_NAME;
                   server = (StreamConnectionNotifier) Connector.open(url);
                   this.logMessage("waiting for connection...");
                   StreamConnection conn = server.acceptAndOpen();
                   this.logMessage("connection opened");
                   InputStream is = conn.openInputStream();
                   byte buffer[] = new byte[1000];
                   while (true) {
                        int numChars = is.read(buffer);
                        String s = new String(buffer);
                        logMessage("received from mobile phone: " + s.substring(0, numChars));
              } catch (Exception e) {
                   this.logMessage(e.getMessage());
    }You need to include the location of WTK as the kvem.home define. If its installed in c:\wtk22 (the default), start the server with the parameter -Dkvem.home="c:\wtk22". You also need to include these 3 libraries:
    c:\wtk22\wtklib\gcf-op.jar
    c:\wtk22\wtklib\kenv.zip
    c:\wtk22\wtklib\kvem.jar
    That's it for the server. My code of the sample client (the mobile phone, running in the WTK emulator) is messy (sorry about that -- still cleaning it up)!
    import java.io.IOException;
    import java.io.OutputStream;
    import java.util.Enumeration;
    import java.util.Timer;
    import java.util.TimerTask;
    import java.util.Vector;
    import javax.bluetooth.BluetoothStateException;
    import javax.bluetooth.DeviceClass;
    import javax.bluetooth.DiscoveryAgent;
    import javax.bluetooth.DiscoveryListener;
    import javax.bluetooth.LocalDevice;
    import javax.bluetooth.RemoteDevice;
    import javax.bluetooth.ServiceRecord;
    import javax.bluetooth.UUID;
    import javax.microedition.io.Connector;
    import javax.microedition.io.StreamConnection;
    import javax.microedition.lcdui.Display;
    import javax.microedition.lcdui.Form;
    import javax.microedition.lcdui.StringItem;
    import javax.microedition.midlet.MIDlet;
    import javax.microedition.midlet.MIDletStateChangeException;
    public class MainMIDlet extends MIDlet {
         protected void destroyApp(boolean arg0) throws MIDletStateChangeException {
              // TODO Auto-generated method stub
         protected void pauseApp() {
              // TODO Auto-generated method stub
         protected void startApp() throws MIDletStateChangeException {
              MainForm mainForm = new MainForm();
              Display.getDisplay(this).setCurrent(mainForm);
              mainForm.initializeDisplay();
    class MainForm extends Form {
         public static final String UUID_STRING = "A781FDBA229B486A8C21CEBD00000000";
         private StringItem log;
         private DiscoveryAgent agent;
         Object lock = new Object();
         static EndPoint currentEndPoint;
         static Vector serviceRecords = new Vector();
         public MainForm() {
              super("BT Client");
         public void initializeDisplay() {
              this.log = new StringItem("", "");
              this.append(this.log);
              try {
                   LocalDevice local = LocalDevice.getLocalDevice();
                   agent = local.getDiscoveryAgent();
                   agent.startInquiry(DiscoveryAgent.GIAC, new Listener(this, agent));
              } catch (BluetoothStateException e) {
                   this.logMessage(e.getMessage());
         public void logMessage(String message) {
              this.log.setText(this.log.getText() + message + "\n");
         public void processServiceRecord(ServiceRecord sr) {
              try {
                   String url = sr.getConnectionURL(
                             ServiceRecord.NOAUTHENTICATE_NOENCRYPT, false);
                   logMessage("opening URL " + url);
                   StreamConnection conn = (StreamConnection) Connector.open(url);
                   OutputStream os = conn.openOutputStream();
                   String smessage = "test message from phone emulator";
                   os.write(smessage.getBytes());
              } catch (IOException e) {
                   logMessage("error while processing service record: "
                             + e.getMessage());
         class Listener implements DiscoveryListener {
              private MainForm mainForm;
              private Vector pendingEndPoints;
              private DiscoveryAgent agent;
              public Listener(MainForm mainForm, DiscoveryAgent agent) {
                   this.mainForm = mainForm;
                   this.agent = agent;
                   this.pendingEndPoints = new Vector();
              public void deviceDiscovered(RemoteDevice dev, DeviceClass deviceClass) {
                   this.mainForm.logMessage("found device");
                   this.pendingEndPoints.addElement(new EndPoint(dev));
              public void inquiryCompleted(int arg0) {
                   this.mainForm.logMessage("done searching for devices");
                   for (Enumeration enm = this.pendingEndPoints.elements(); enm
                             .hasMoreElements();) {
                        EndPoint ep = (EndPoint) enm.nextElement();
                        ep.calculateRemoteName();
                        this.mainForm.logMessage("device name: " + ep.getRemoteName());
                   new Timer().schedule(new DoServiceDiscovery(), 100);
              public void servicesDiscovered(int transID, ServiceRecord[] arg1) {
                   mainForm.logMessage("found " + arg1.length
                             + " service(s) on device "
                             + currentEndPoint.getRemoteName());
                   for (int i = 0; i < arg1.length; i++) {
                        serviceRecords.addElement(arg1);
              public void serviceSearchCompleted(int arg0, int arg1) {
                   synchronized (lock) {
                        * unlock to proceed to service search on next device see
                        * DoServiceDiscovery.run()
                        lock.notifyAll();
                   mainForm.logMessage("done searching for services on "
                             + currentEndPoint.getRemoteName());
              * Inner class. Called a short time after the last device is found.
              class DoServiceDiscovery extends TimerTask {
                   public void run() {
                        try {
                             UUID uuids[] = new UUID[2];
                             * ok, we are interesting in btspp services only and only
                             * known ones -- check for our UUID
                             uuids[0] = new UUID(0x1101);
                             uuids[1] = new UUID(MainForm.UUID_STRING, false);
                             for (Enumeration enm = pendingEndPoints.elements(); enm
                                       .hasMoreElements();) {
                                  EndPoint ep = (EndPoint) enm.nextElement();
                                  mainForm.logMessage("searching for services on "
                                            + ep.getRemoteName());
                                  currentEndPoint = ep;
                                  ep.transId = agent.searchServices(null, uuids,
                                            ep.remoteDev, new Listener(mainForm, agent));
                                  synchronized (lock) {
                                       try {
                                            lock.wait();
                                       } catch (InterruptedException e) {
                                            // do nothing
                                            mainForm.logMessage("exception while waiting: "
                                                      + e.getMessage());
                             mainForm.logMessage("discovered all services; found "
                                       + serviceRecords.size() + " record(s)");
                             * assume we have just 1 service record
                             if (serviceRecords.size() > 0) {
                                  processServiceRecord((ServiceRecord) serviceRecords
                                            .elementAt(0));
                        } catch (Exception e) {
                             mainForm.logMessage("error during service discovery: "
                                       + e.getMessage());
    class MiscUtils {
         * Get the friendly name for a remote device. On the Nokia 6600, we're able
         * to get the friendlyname while doing device discovery, but on the Nokia
         * 6230i, an exception is thrown. On the 6230i, we get the friendly name
         * only after all devices have been discovered -- when the callback
         * inquiryCompleted is called.
         * @param dev
         * the device to examine
         * @return a friendly name for the device, otherwise the IP address as a
         * hex-string
         public static String getDeviceName(RemoteDevice dev) {
              String devName;
              try {
                   devName = dev.getFriendlyName(false);
              } catch (IOException e) {
                   devName = dev.getBluetoothAddress();
              return devName;
         public static EndPoint findEndPointByTransId(Vector endpoints, int id) {
              for (int i = 0; i < endpoints.size(); i++) {
                   EndPoint endpt = (EndPoint) endpoints.elementAt(i);
                   if (endpt.getTransId() == id) {
                        return endpt;
              return null; // not found, return null
    class EndPoint {
         // remote device object
         RemoteDevice remoteDev;
         // remote device class
         DeviceClass remoteClass;
         // remote service URL
         String remoteUrl;
         // service hosted on this device -- populated after searching for devices
         ServiceRecord serviceRecord;
         // bluetooth discovery transId, obtainsed from searchServices
         int transId = -1; // -1 must be used for default. cannot use 0
         // local user nick name
         String localName;
         // remote user nick name
         String remoteName;
         // vector of ChatPacket pending to be sent to remote service.
         // when message is sent, it is removed from the vector.
         Vector msgs = new Vector();
         public EndPoint(RemoteDevice rdev) {
              remoteDev = rdev;
         * This functionality isn't called in the constructor because we cannot
         * retrieve the friendly name while searching for devices on all phones. On
         * some phones we have to wait until after devices have been discovered.
         public void calculateRemoteName() {
              this.remoteName = MiscUtils.getDeviceName(this.remoteDev);
         public RemoteDevice getRemoteDev() {
              return remoteDev;
         public String getRemoteName() {
              return remoteName;
         public ServiceRecord getServiceRecord() {
              return serviceRecord;
         public void setServiceRecord(ServiceRecord serviceRecord) {
              this.serviceRecord = serviceRecord;
         public int getTransId() {
              return transId;
    ...and that's it. Start the server, then the client (all on the same machine) and you've simulated bluetooth between the 2.
    To get the server working with a real mobile, you'll need to use the BlueCove library instead of the 3 WTK jars (and can remove the kvem.home directive as well). The rest of the code should remain the same (haven't quite tested that yet!).
    cheers
    Manoj
    null

  • Java server and C# client

    Hallo,
    Please, Can you help me. I´m looking for Java server run on the Linux Debian.
    The Server in Java must be very good implementation (connect many client-500workstation).
    I have workstation ( Microsoft Windows XP, 7 ) and on the workstation must be client(in C#).
    The client say: a need information from Database and connecting to the Server in Java. The server in Java
    connect to the - Database(Oracle) and send information back to the workstation
    and workstation save as file.This is process before starting Windows, I need information
    for the starting script.
    For the Example, I have in databese name of instalation pack.
    Example implemention :
    On the workstation running agent.exe as service. I say in my script:
    (agent.exe -IdPack) and my agent connect to the Server and downloading information and save to the
    file(for example XML) in computer.
    Please, Do you know any solution?Any source code?project?
    I think, the server on the linux can be implementation in java servlet or next programming language.
    Thank You. Lukas

    Lukas-Firewall wrote:
    I´m administrator on the network. And we have information about computer in Oracle database. The information we need on the workstation windows and I need downloading from Database in Oracle and I need server which connect to the database and send back to the workstation the information. Do you understand me?So you have information in a database, and want some way of having that information accessible on Windows desktops? I don't see any need for C# clients here, surely a simple web app in a container like Tomcat will suffice? How complex is this information? In fact, so far I haven't seen any reason why you even need Java here. Can't you just throw some PHP at it? Where does C# come into the equation? Writing a custom rich client can often be avoided by using a web browser, especially if it's just a matter of taking some data from a DB and displaying it - makes your life much simpler.

  • Document Units between InDesign Server and InDesign Client

    I am working between a Client application using InDesign CC and a Server application using InDesign Server CC.  The problem is that the Clients have their default document width/height settings set to Picas whereas the Server's settings seem to be in Inches.  This is causing problems when Server application is trying to generate a PDF in the units specified by the client.  I need help in figuring out how to get InDesign Server to use Picas instead of Inches.
    Here is a sample of the code used to look at the page width/height values.  I have a module-level boolean called 'mInDesignServer' set to True to test with InDesign Server and False to test with InDesign:
                     If mInDesignServer Then
                        doc = DirectCast(Application.Documents, Global.InDesignServer.Documents).Add
                    Else
                        doc = Application.Documents.Add
                    End If
                    doc.ViewPreferences.RulerOrigin = Global.InDesign.idRulerOrigin.idPageOrigin ' Global.InDesign.idRulerOrigin.idSpreadOrigin
                    doc.ViewPreferences.HorizontalMeasurementUnits = Global.InDesign.idMeasurementUnits.idPicas
                    doc.ViewPreferences.VerticalMeasurementUnits = Global.InDesign.idMeasurementUnits.idPicas
                    doc.ZeroPoint = myZeroPoint
                    ' Look at the document preferences
                    Debug.WriteLine(IIf(mInDesignServer, "Server", "Client") & " " & _
                        "Page Height: " & doc.DocumentPreferences.PageHeight & " " & _
                        "Page Width: " & doc.DocumentPreferences.PageWidth & " " & _
                        "Page Size: " & doc.DocumentPreferences.PageSize)
    Here is the output from the Debug.WriteLine statement when run under both conditions:
         Server Page Height: 11 Page Width: 8.5 Page Size: Letter
         Client Page Height: 66 Page Width: 51 Page Size: Letter
    As stated above, how can I get InDesign Server CC to change its default units to Picas to match that of the Client?
    Thanks,
    Jody

    This worked for me...
    oDocument.ViewPreferences.HorizontalMeasurementUnits = idMeasurementUnits.idMillimeters
    oDocument.ViewPreferences.VerticalMeasurementUnits = idMeasurementUnits.idMillimeters

  • Sharing DSL between Mac Server and PC client

    Hello,
    I'm running a small Mac server network of 3 Mac clients and 1 PC. They are all connected via ethernet to a switch. There is a DSL modem also connected to the switch. The modem software was installed on the Mac server.
    The Mac clients can access the Mac server as well as access the DSL modem to get on-line. The PC is running XP Pro. I can either set up his LAN network connection to see the Mac server or manipulate the settings in that same LAN network connection to see the DSL modem and get on-line. I can't seem to do both.
    On the Macs, I set up separate network configurations with the appropriate tcp/ip settings required for the 2 tasks in question.
    It seems like there should be a way to set up another separate LAN connection on the problem PC, much like I did on the Macs, to allow both server and DSL access.
    1. Does anyone know if this is possible?
    2. Does anyone know of another way to get the pc to see the server and the dsl simultaneously, using the same ethernet connection?
    Thank you in advance for any help.
    Allan
    p.s. The macs are running 10.39 and the server is running 10.1.2.

    Hi Allan!
    I suggest you replace your switch for a router. The purpose of a router is to connect two networks. In your case it would connect your local computer network (Macs, server and PC) to the Internet. Having your DSL on a switch with the rest of your machines means that only one at a time should be able to connect to the Internet.
    Hope this helps! bill
    1 GHz Powerbook G4   Mac OS X (10.4.8)  

  • Diff between Java,Window and HTML Clients

    Hi can any body clear me
    what is the difference between
    1. JAVA Client
    2. Windows Client
    3. HTML Client.
    regards
    mmukesh

    The Windows client requires SAPGUI for Windows loaded on the dekstop (400+ MB of disk), but it works most efficiently.
    The HTML client requires an ITS and is not as efficient, but need no specialized software on the desktop.
    The Java client is almost never used except by Mac and Unix users!
    Cheers
    try searching SDN for SAPGUI variants for more details

  • Communication protocol between Admin Server and Managed Server

    Hello - I am hoping someone can help me here to understand the communication protocols used in my setup.
    Here is my understanding of the protocol that are used between each component.
    End User <--->HTTPS<--->LoadBalancer Device<--->HTTPS<--->Web Server<---->HTTPS<--->WebLogic Server(Managed Server)<--->LDAP/JDBC<-->Data tier components
    AdminServer<--->T3<--->Managed Server i.e. The communication protocol between Admin Server and Managed server is T3
    The communication protocol between Managed Servers running in one cluster on two seperate machine is What?
    Thank you.

    Hello, interesting question.
    In the documentation " [cluster multicast communication|http://download.oracle.com/docs/cd/E13222_01/wls/docs90/cluster/features.html#1007001] " don't specify the used protocol to pack the information for example in a session replication.
    Although in a session replication all objects must be serializable i don't think rmi protocol is used.
    I hope some expert give us some light in this issue :-)
    http://download.oracle.com/docs/cd/E13222_01/wls/docs90/cluster/features.html#1007001

  • Move SCOM agent between gateway server and management server ?

    Dear all,
    IN SCOM 2012 R2 is it possible to move SCOM agent between gateway server and management server ? I mean if one agent is reporting to Gateway server , in case if i want to shutdown that Gateway server , can i move to another Management server and
    Vice versa ?
    Thanks,
    Sengo

    Hi,
    http://blogs.catapultsystems.com/cfuller/archive/2012/06/05/how-does-the-failover-process-work-in-opsmgr-2012-scom-sysctr.aspx
    and links at the bottom of
    the article

  • Replication between Oracle Server and MS SQL Server

    Hello,
    Does anybody know of a well known or reliable software that can do data replication between Oracle Server and Microsoft SQL server.
    I suppose I can write my own version using Heterogenous Services in Oracle but I would like to know if such an automated replication between Oracle and SQL is available commercially.
    Thank you.

    Viacheslav Ostapenko wrote:
    Sorry, Aman,
    I couldn't find any info about replication to MS SQL. Is it possible at all? Could you provide link where we can read about this? It could be very interesting.Sorry Viacheslav, even I couldn't find anything for the same. I am not sure that it can be done or not, I haven't heard anyone in my contact doing so. The only place where I have seen Streams being used around me is within Oracle db only. May be someone else can help if he/she has done it.
    Aman....

  • Machine server and machine client

    Hello,
    i need to create a communication between two machines solaris 2 installed in VM workstation; to begin with NFS and do these :
    Machine A : share -F nfs /opt
    and in Machine B : mount -F nfs machineA:/opt /mnt
    also
    share -F nfs -o rw=machineB /opt
    and in B
    mount -F nfs machineA:/opt /mnt
    MY need its just about networking between two machines installed in my VM and create a server and a client machine!
    @IP machine A :192.168.1.2
    @IP machine B :192.168.1.3
    may i create an unique domain?
    pleaz show me step by step, im still a beginner with solaris 10 administration part 2.
    Thank you,
    Herbich

    According to certification matrix (metalink) 32bit clients (9.2 and higher) are supported on 64bit servers. Of course in their own ORACLE_HOME.
    Werner

  • Stun server and stun client

    I came across a concept stun server and stun client....is it possible to use these things in video conferencing in internet.pLease help.....for implemenation and materials,code also

    Hi this is Ramesh iam developing an desktop video conferencing application.
    when i use RTP it is working good in Lan but not in internet.
    so that now planed to use JStun and i have source also while running iam getting this exception
    D:\project\jstun\src>
    java de.javawi.jstun.test.demo.StunServer 42050 121.246.235.202
    42058 121.246.235.202
    java.net.BindException: Cannot assign requested address: Cannot bind
    at java.net.PlainDatagramSocketImpl.bind0(Native Method)
    at java.net.PlainDatagramSocketImpl.bind(Unknown Source)
    at java.net.DatagramSocket.bind(Unknown Source)
    at java.net.DatagramSocket.<init>(Unknown Source)
    at java.net.DatagramSocket.<init>(Unknown Source)
    at de.javawi.jstun.test.demo.StunServer.<init>(StunServer.java:44)
    at de.javawi.jstun.test.demo.StunServer.main(StunServer.java:241)
    121.246.235.202 is my server ip address.which ip i need to use and which port i need to use.
    please give me a brief idea how i can run this.
    if u have any code which is running on internet for video transmission please send me.
    i hope u will help me.
    my mail id :[email protected]

  • Selecting between java.io and java.nio

    Hi,
    I'm a bit confused between java.io and java.nio. What sre the major differences between these two?
    In areas are these best applicable?

    The java.nio package improves on the basic Java I/O that was available prior to JDK 1.4.
    It is designed to interoperate more natively with the underlying file handles (sockets, open files etc) to achieve better performance.
    The improvements include true non-blocking I/O, better buffer management, character-set support, channels (similar to Occam's channels) and selectors, and some other ancillery stuff. Most of these classes are designed to be inherently threadsafe.
    There are some examples here:
    http://java.sun.com/j2se/1.4.2/docs/guide/nio/example/index.html
    However, if you are still a beginner with file or network I/O, its better if you start with the simple I/O first. You'll appreciate the NIO improvements better afterwards.

  • Diff between Application server and Webserver?

    Diff between Application server and Webserver?

    asked soooooo many times already...
    Basically an application server has more functionality than a webserver, such as enterprise javabeans. That is assuming we are taking about a java webserver like Tomcat.

Maybe you are looking for

  • Need help in formating chart in OBIEE

    Hi All, We need to show Retail Qty, Objective and % of Objective by Region in chart. My requirement is to show Retail Qty and Objective as vertical bars and % of Objective as Trend line by Region. Currently am using stacked bar for Retail Qty, Object

  • Revit 2013 on my 2009 mac book pro

    I am interested in running AutoCAD Revit MEP on my macbook. My current specifications are: Mac OS 10.6.8, Processor 2.4Ghz intel core 2 Duo, Memory 4GB 1067 MHz DDR3, Griphics NVIDIA GeForce9400M I'm also running Windows XP 32 bit Professional throug

  • WGN audio not in sync

    The audio on WGN is not in sync with the video.  It seem to be a problem only on the WGN feed, I checked a replay of the WGN nightly news on CLTV, and everything looked fine. 

  • 6111 speaker very soft.. is that a problem

    6111 speaker very soft.. is that a problem.. Hi i had a few nokia's before and this one takes the cake for being very soft at the speaker... i cant walk and talk at the same time.. i have to stand still in a sound room.. is this normal.. i mean you c

  • Adobe flash player update notification

    I have the latest version of Google Chrome on a Mac OSX.  I just got this pop-up on my screen. Is it legitimate, or might it contain malware?Is