programming socket

I hope someone can offer suggestions. I am new to the development of blackberry and java, so I'm a little out of my element.

I need a direct socket to my server connection. I'm using an object SocketConnection and helps open InputStream and OutputStream objects to read and write on my server. The communication is successful, and I get the data that I expect. The problem is that at the opening of the SocketConnection, the resolution of the server is very slow. I mean by slow that open the plug, send the request and receive the reply takes on the scale of anywhere from half a second to 5 seconds. My .net (Windows Mobile 6.1) application to talk to the same server tops out at about 1 second with average call time of 300 milliseconds.

.NET allows me to create an IPHostEntry object that I can store and then use to provide the IP address to the Socket object which makes the opening of the Socket connection virtually instantaneously.

Is there a way I can do on the blackberry?

I was wrong in what I saw. Being new to the environment and making assumptions based on what I ran in with the Windows version, I thought that the problem was in the connection. It turned out that I grossly mishandling my InputStream, and this was what was actually causing the blow.

Glad to find a simple solution to a type of embarrassing problem

Thanks for the comments.

Tags: BlackBerry Developers

Similar Questions

  • Programming socket with flex

    I have a Windows Mobile application written using c ++.  Is it possible for it to communicate with a flex application using socket programming?

    Just what I need if, for the application of flex under open a socket and listen.  I have this work with a c# server and need to know if flex can do the same thing?

    Thank you

    Hello

    Move applications to create air and then your Air Application can be server.

  • OSB Socket

    Hello
    I am a beginner of SOA and I c# development experience.
    It was built only oracle given sample (http://docs.oracle.com/cd/E13159_01/osb/docs10gr3/transportsdk/example.html) and works well.

    My question is: can I use c# to develop programming socket and the connection with the BSO.

    HOW?

    it very improtent us, pls answer me as soon as POSSIBLE so you well kown.

    Thank you.

    As any OFMW (including SOA and OSB) is developed on Java, I didn't think you can develop a transport of OSB in c# but if you just want to connect to a service of OSB on socket (do you want to develop client socket), you can use any programming language.

    Kind regards
    Anuj

  • Find the address of the server

    I wish I could find the address of a server on my LAN.


    I was doinking autour (specific local technique therm it) with an idea of game and in my thought process of the design of the game, I want to do the following in the implementation:


    I, or anyone can get online to play the game (not a problem, I can program sockets).


    When a potential player comes online, they would choose if they want to host the game or just participate and if there are already guests, give them a list that do not exist to join.  This is my problem.  The IP address of the server would not be known at the time of everyone online, and it could be that any address covered in my local block 10.0.0.XXX or 192.168.0.XXX, well, except the address of the router.


    In all the work I did in the past, the IP address of the server has always been known.  Also in the examples that I have on the net and my books all assumed that you know the IP address of the server, that is not a problem and I've done several times, but now I'm looking for the basic idea of how "discover a server on the network.


    I thought that this day is: use a type of force noise of algo where the client checks literally just everything in the local block using the Protocol for the game.  Which is the way to do it using simple TCP/IP and Java or is there a more elegant way that I'm missing?


    I am not coding examples, but just the basic audit idea or approach... even a suggested google search would be appreciated.

    As long as it is the local network and the router (or other infrastructure network) does not, you can use a UDP.  When a server comes online and maybe and regular intervals after that, she broadcasts a message "Server" here on a UDP port.

    Clients listen on UDP port and collect addresses.

    The alternative to this, when UDP is not possible (internet) is to have a dedicated communications server which is accessible to all.  There is no that indicate which servers are up.  Servers to validate the availability and customers ask servers lists.

  • A custom RMISocketFactory affect Naming.lookup

    I have an obligation to fix the server ports and client used by our RMI application.
    I understand that the customer port of fixation is a bad option, as it would obviously be the cause of performance problems.

    So, I'm working on fixing server-side ports.
    So far, I have created a custom RMI SocketFactory that uses a 10 port range(7000-7010) for the work.
    Now when I use the application I see the range used on the network.
    However, apart from the ports defined in the CustomRMISocketFactory there other ports I still see in network traces.

    The correction I made I see that these ports are generated right after the called (< String >) Naming.lookup.
    It is obvious that there is a port on the server running the registy. (port 9011)
    But I don't understand what is causing the other ports used. (These ports are selected randomly and keep changing).

    Please let me know if anyone can guide me in the correct path.

    i. is there any published document which covers the fact that fix the client ports is not recommended along with reasons. I do not understand the reasons, but a document reference would help immensely. Perhaps a pointer to where I can get these documents.

    Search these forums, so Networking forum and the forum read-only programming Socket so you can find it. I expressed my point of view on this issue on many occasions, and nobody has ever refuted them or even they questioned in 14 years.

    The fact is that the Sockets API simply does not provide a way to specify a range of outbound ports when creating a connection and or because of Java, either taking level or on the MRL level. Some firewall provides the ability to create rules for the outgoing port ranges, but is only by symmetry with beaches of incoming ports, i.e. using the same configuration code for both.

    So that there is no support for demand for the outgoing port ranges, they do not have to be specified. Period.

    However, I would take the other side: let those who are in favour of outgoing port (a) ranges providing concrete reasons as to how this improves the security of networks and (b) indicate how to implement it. Java RMI.

    II. If I understand correctly the ports used by the DGC to track customer references have no can be fixed.

    In the absence of plug plants, there is automatic port sharing, i.e. After you have exported an object on a port, a port, that they are user-defined or chosen by the system, the following objects are exported on the same port, unless otherwise stated. Who should apply to the Canadian Guild of Directors object as well as your own. I guess that your socket factories got in the way, which one time that you remove them he's going to fix everything himself nicely.

  • Orbit Downloader program does not work with error "Socket 10061 error".

    Original title: socket error 10061 Orbit Downloader

    I use Orbit Downloader 4.1.1.2 to download files. It worked fine on my system. I have install/uninstall some software (as Commander of the registry and a software tweak system). But now, Orbit Downloader does not work. Below here are the logs when it tries to download the www.google.co.in homepage.

    Connection failed! Socket error = 10061
    Connection www.google.co.in:80
    Waiting for retry (5s)
    I try to run the orbit after you turn off the firewall and antivirus too, but it doesn't work. I use Windows 7 Home Premium. Please guide me to debug this problem.
    Hello
     
    1 are you facing the question only download this program, or with other programs?
    2 are you faced with the issue in the different browser? For example: Google Chrome, Firefox, etc.
    3. have you checked with the manufacturer of the program?
     
    Try the methods and check after each method.
    Note: the information provided in the above article are also applicable to Internet Explorer9.
     
    Method 2: Try the methods provided for in article below and check after each method:
    How to optimize Internet Explorer:
    http://support.microsoft.com/kb/936213/no
    Warning: Reset the Internet Explorer settings can reset security settings or privacy settings that you have added to the list of Trusted Sites. Reset the Internet Explorer settings can also reset parental control settings. We recommend that you note these sites before you use the reset Internet Explorer settings.
     
    Method 3: If you use the Internet Explorer browser, uninstall and reinstall Orbit Downloader 4.1.1.2, if it is a program.
     
     
    If the problem persists, I suggest you please contact the manufacturer of the program for extra support.
     
     
    It will be useful.
  • Establishing a socket connection between a .swf file and a current-test program (TCP/IP generator - Windows), in AS3.

    I have a problem with a college project, I'm trying.

    Using Actionscript 3, I did a program simple .swf, a smiley face, lively and interactive, which "reacts" number entered in an input box.

    For purposes of this project, I now do the framework for establishing a connection socket with the smiley .swf and another program.

    That's where I run into problems. I have very little knowledge of the AS3 programming, so I'm not sure how the connection - what is required for it, it is.

    To test the connection, I try to use the "TCP/IP builder" program for windows, which allows me to set up a server socket. I need to program the .swf file into a client - to recognize, connect to it, then be able to receive data (so that data then allows for the smiley "react" him--like how he does now with the input-box, 'automatically' as it gets the data, rather than by manual input).

    My attempts at codification it are as follows, with the help of a tutorial (link HERE):

    INSERT HERE THE SOCKET STUFF

    //****************************************************************

    var socket:XMLSocket;

    Stadium. addEventListener () MouseEvent. ( CLICK, doConnect ();

    It connects to the local port, 9001 and applies event listeners

    ( function doConnect ()evt:MouseEvent():void

    {

    Stadium. removeEventListener () MouseEvent. ( CLICK, doConnect ();

    socket = new XMLSocket()'127.0.0.1', 9001);

    outlet. addEventListener () Event. ( CONNECT, onConnect();

    outlet. addEventListener () IOErrorEvent. ( IO_ERROR, onError ();

    }

    This locates the connection (allows us to see what has happened or failed)

    function onConnect () evt:Event():void

    {

    trace ("Connected"();

    outlet. removeEventListener () Event. ( CONNECT, onConnect();

    outlet. removeEventListener () IOErrorEvent. ( IO_ERROR, onError ();

    outlet. addEventListener () DataEvent. ( DATA, onDataReceived ();

    outlet. addEventListener () Event. ( NARROW, onSocketClose ();

    Stadium. addEventListener () KeyboardEvent. ( KEY_UP, keyUp ();

    }

    ( function onError() evt:IOErrorEvent():void

    {

    trace ()"Login failed"();

    outlet. removeEventListener () Event. ( CONNECT, onConnect();

    outlet. removeEventListener () IOErrorEvent. ( IO_ERROR, onError ();

    Stadium. addEventListener () MouseEvent. ( CLICK, doConnect ();

    }

    Here, the flash titles what keyboard key.

    If you press 'q', the connection ends.

    ( function keyUp() evt:KeyboardEvent():void

    {

    if (evt. ( keyCode == 81( ) / / key for q code is 81

    {

    outlet. Send ("exit");

    }

    on the other

    {

    outlet. Send (evt. keyCode );

    }

    }

    It must manage the data that we get from the server.

    ( function onDataReceived ()evt:DataEvent():void

    {

    try {

    trace ()"Server:", evt. data );

    }

    catch (e:Error) {

    trace ('error');

    }

    }

    ( function onSocketClose ()evt:Event():void

    {

    trace ()"Closed connection"();

    Stadium. removeEventListener () KeyboardEvent. ( KEY_UP, keyUp ();

    outlet. removeEventListener () Event. ( NARROW, onSocketClose ();

    outlet. removeEventListener () DataEvent. ( DATA, onDataReceived ();

    Try to connect to the Jack gives me no result (other than a "Connection failed" message when I click the .swf) or the following error message:

    Error #2044: unhandled securityError:. text = Error #2048: security sandbox violation: file:///C|/Users/Marko/Desktop/Završni/Flash%20documents/Smiley%5FTCP%5FIP%5Fv4.swf cannot load data from 127.0.0.1:9001.
    to the Smiley_TCP_IP_v4_fla::MainTimeline/doConnect()()[. Smiley_TCP_IP_v4_fla ] [MainTimeline: frame1:12]

    127.0.0.1 could be supported through your HTTP software, I'm not familiar with the tool you are using. It could also have been show in your hosts file (in Windows you will find here: C:\Windows\System32\drivers\etc). Check to see if something is the substitution of 127.0.0.1 (local loop).

    Apart from that, I've given you source to a rapid AIR server that has just opened a listener to 127.0.0.1:8910 so you would need no other tools to test the client, even if you have a. I just include the source and a product AIR installer so you can reproduce them to see that I do anything malicious. The Server.air file must be "installed" to test it. When you double-click it, it is a Setup. He moved to C:\Program Files (x 86) \Server (should have called something less common in hindsight). It also has a checkbox to run it after installation. If you don't you will see the server pop up a standard window of 550 x 400 with a text inside the box there letting you know that it is listening. Everything connects, messages (channels) and disconnects the will displayed in the Server text box.

    The customer is the only SWF file, you must run, after 'something' listening on the IP address and port configure you with.

    Here is a picture to show you the server is not running in the same folder the SWF did, tell the server and it only run the client exactly how I should it look like all together:

    I'll show you that after running the Server.air Installer, here is the the path of the executable file is running from and the client SWF isn't here. No problem connecting despite being in different places.

    The server is running and says that it is listening on 8910. Feel free to modify the source and reproduce for a different IP/port.

    -J' open the Client.FLA and just run. It creates a new socket, add headphones, connects to 127.0.0.1:8910.

    -The server responds that he sees and accepts the client connection. The server sends a message "connected." (10 bytes) to the customer immediately.

    -The client receives data (String), he draws. The customer sniffs for this specific message, and then sends the server a string "thanks for the connection!

    -The server receives and is coded only to echo the string in the "Echo - thank you to connect!" back to check that the chain is correct.

    -The customer receives the echo of servers (30 bytes), he draws.

  • Slow, Satellite Pro M70: xferrecv_recvMain2(): error socket() 3135, 10106

    Hello world

    Since yesterday, I have problems with my laptop.
    He needs minutes after minutes to start and then I get no connection to my WLan system. When starting, I get after a while the message "xferrecv_recvMain2(): error socket() 3135, 10106.»

    Right now I can t use the laptop, because she needs a lot of time to react after you start a program etc.

    What is a defect on the chips of RAM?

    I use the factory ones, not additional ones.

    Thank you very much for your support.

    Best regards
    Patrick

    You can test the memory with Memtest www.memtest.org. Its a floppy disk or a bootable CD.

    The HARD drive could be faulty, check using the advanced options of Hitachi DFT test (find it in Google).

  • More than 2 Sockets of RAM Qosmio X 770 - 107 or another?

    Hey guys,.

    I found two entries in tools Systeminformation, and I can't believe if its right.

    [4 Slots of Ram | http://imageshack.us/photo/my-images/804/ram4.jpg/]

    If there are really 4 Ram slots, has perhaps its best to run Notepad with 16 GB of RAM... (4 x 4 GB - 8 GB possible Modules not supported).

    Here, someone who can check if it has really 4 Sockets in RAM in the laptop?

    I used to make the visible slots on the programs:

    EVEREST Corporate Edition
    CPU - Z 64

    Hi nvomlehn

    The Qosmio X 770 motherboard supports two memory locations.
    The information that will certainly not my CPU - Z.

    Welcome them

  • Satellite L300 - T2FTP Windows sockets of initialization failed

    After login, I get the following message:

    T2FTP Windows sockets of initialization failed

    At the same time, the system issues a message that he has found a new unknown device and the driver must be installed.

    Before that I did NOT add a new hardware device.

    Click the button start only generates a message: Windows Explorer does not react.
    It is impossible to call any other routine.

    Unfortunately I can not find my recovery CDROM.

    Are there opportunities to save my system?

    Toshiba Satellite L300 model PSLB8E
    Windows VISTA-32 bit

    Hello

    I never met such a problem. Have you installed any programs recently? It seems that the software related issue. To be honest, it is sometimes easier to reinstall the operating system than to try to fix it.

  • Satellite L30: CFSServ "Windows Socket error.

    Hello

    Every time I try to go on internet, this warning sign appears (a yellow triangle with an exclamation mark inside) saying CFSServ "Windows socket error.
    It allows me to go on my internet (what is broadband) gave me solutions such as put the Windows XP CD in the CD drive and repair of each file, but the thing is, I never gave me a cd of Windows XP in the first place! As soon as I opened the box and set up the laptop, there is no CD of windows xp.
    (I'm typing this from my desktop computer) I wish that all solutions on how to get rid of this problem.

    Thanks to all who help.

    Post edited by: ringmaster164

    First you get a Toshiba Recovery CD and not an original Windows OS CD.
    In this case, if you want you can retrieve the whole OS. All Toshiba drivers are preinstalled on the image.

    Now to the error:
    cfsserv.exe is a process belonging to Toshiba ConfigFree utility and search wireless devices.
    However, malware often use the names of valid program to try to hide themselves. So, please run a full scan with Ad-Aware in making sure you have the latest definitions file.

    If it doesn t work I recommend the ConfigFree tool for some audit settings.

  • Before headphone and microphone Sockets does not

    Hi again. I installed a sound surround my dekstop compatible audio card and it works fine. The problem is that I have to keep changing the connections at the back of the computer when I want to use headphones. As I am a gamer and you watch a lot of movies/TV shows on my desktop, which happens frequently, and it becomes very annoying.

    How can I get the sound of the new sound card to the sockets on the front of my computer?

    This is the connector that came the sockets on the front of the office. He's not going into a slot on my motherboard, but it does not on the audio card anywhere:

    Link to photo

    Here are the different slots in connector on the sound card:

    Side 1, top view

    Link to photo

    Side 2, top view

    Link to photo

    2, side angle view

    Link to photo

    Thanks in advance for any help you can offer.

    Note of the moderator; image (s) for a total of > 50 K converted for the programming of the Forum rules

    Hey prophecy 28,.

    When you install a sound card into the PCIe slot on desktop is now your help for her most of the time. There is no way I know to which allows to connect your soundcard to the jacks before your turn. Cards its equipped with Sockets built into the card and should be used as they are designed. I can see how it can be annoying having to switch cables to say your surround sound system to let you Carlin in your headphones, then put it back again. I tend to leave my connected surround sound system and plug my headphones into the front sockets on my computer. Now some surround sound system equipped with Sockets for headphones you plug your headphones in too.

    If you have any other questions or there is a way I can more help please come back.

    Best regards

    Hiro

  • Change the color of the frame of the socket in parallel Mode

    Hello, good day everyone!

    I'm runnning my sequences in parallel Mode.

    When I run a sequence, its color of frame socket continue in blue.

    When I finish a sequence, its color of frame socket turns green momentarily.

    I would like to change that color by program from my TestStand sequence. I don't know if it is possible.

    Example: If the sequence is waiting for something, the color should change to Orange.

    ---

    When I wanted to change the text that appears in the large textbox of the socket, I had to add the code to my paralleluutdlg.c, the PostParallelUUTDialogStatusMessage function.

    http://forums.NI.com/T5/NI-TestStand/parallel-model/m-p/345847/highlight/true#M10401

    I think maybe I need to add something like this once again to change the color, but I've found nothing related.

    Thanks in advance!

    Hello

    I did recently added this feature to my system. I did it by modifying the example in this article in the knowledge base of NOR. I don't know if it's the best way to handle this, but it worked fine for me. I have modified the function as shown below. You simply pass your message and the hexadecimal color you want to use.

    Hope this helps, maybe someone more knowledgeable can ring in to see if my work practice seems ok.

    _stdcall DLLEXPORT int PostParallelUUTDialogStatusMessage (int dlgHandle, int testSocketIndex, int myColor, char * statusMsg)
    { Int error = 0;}
    ERRORINFO errorInfo.

    int panelId = dlgHandle;
    int childPanel = - 1;

    PUUT_PanelData * panelData = NULL;
    TestSocketData * testSocketData = NULL;

    errChk (GetPanelAttribute (panelId, ATTR_FIRST_CHILD, & childPanel));
    errChk (GetPanelAttribute (panelId, ATTR_CALLBACK_DATA, & panelData));

    testSocketData = & (panelData-> testSocketDataArray [testSocketIndex]);
    SetCtrlAttribute (childPanel, testSocketData-> tonalite [kTSCtrl_Bg], ATTR_FRAME_COLOR, myColor);

    SetCtrlAttribute (childPanel, testSocketData-> tonalite [kTSCtrl_TestSocketIndex], ATTR_TEXT_BGCOLOR, myColor);

    errChk (ResetTextBox (childPanel, testSocketData-> [kTSCtrl_Status] tonalite, statusMsg));

    Error:

    error return;
    }

  • Parallel/lot Sockets using different I / O &amp; Com

    Guys,

    I'm working on a test that will use the parallel model or batch editing.

    For each DUT (testpoints), there is a table attached relays, connected to a single Bay of Amnesty International.

    I want to be able to switch to a different picture of relay for each socket.

    Example:

    0 - VCC_3.vi, SW0_0on, switch socket

    Bushing 1 - VCC_3.vi, SW1_0on / stop--> waiting for socket 0 end with VCC_3.vi, pass a different IO

    Etc. for all and the steps

    I also need of each use a different "com_port.vi".

    Looks like I need a model of Seq / by hyb?

    I couldn't find much in the way of relevant discussions on this subject, so I hope that you have some knowledge to share!

    Any suggestions would be greatly appreciated.

    -Derrick

    A couple of things about your question:

    You should be fine with just the parallel model or batch.  Personally, if you do not need to switch dynamically on DUT then I would go with the model of batch processing.  Why?  Because you can use synchronized sections.  Synchronized sections give you the ability to run a particular section of your movie file (i.e. several or a single step) in parallel, in the order or an outlet only.  With the parallel model you can kind of get there using locks and queues.  Search the Handbook of TestStand under annexes A and B for more information on the model of batch and synchronized sections.  To access the TestStand Reference Manual go to start > all programs > National Instruments >> Documentation > manuals.

    Regarding your screws and how they would handle each socket.  I don't think it's a good idea to do a different VI for each socket.  Just have some sort of case within the VI if 3 provided throughout the wires just to fill your switching or COM functions  For example: lets say 1 Socket runs and get to the step to call the com_port.vi.  One of the parameters for VI could be the number of the socket.  Inside of the VI you set the com port to read or write based on this setting.  You can set the parameter in TestStand using RunState.TestSockets.MyIndex (which will return taking you on that).

    In fact, you must even logic in your com_port.vi.  I guess one of the parameters in this VI would be a VISA session for your COM ports.  In TestStand, you use the LabVIEWIOControl data type which has the DeviceName property.  If you set this parameter to be '' COM' + Str (RunState.TestSockets.MyIndex)' then you will get the same thing from COM3 if you were in TestSocket 3.

    In any case, it's just a few ideas for you.  Of course, it must implement what makes sense.

    Hope this helps,

  • How to collect data on the programs of LabView and VC ++ at the same time?

    Hello

    There are two programs in LabVIEW and another is in VC ++. The two programs to collect hardware data.

    Therefore, for the experience, it is necessary to begin to collect data at the same time and lag must be

    less than millisecond (it is essential for the experience). How can this be achieved? BTW, I'm new to LabView.

    I think on the use of network socket to get the message for both applications.

    I was wondering if there is a better way.

    Thank you.

    MARK002-MAB wrote:

    Hello

    There are two programs in LabVIEW and another is in VC ++. The two programs to collect hardware data.

    Therefore, for the experience, it is necessary to begin to collect data at the same time and lag must be

    less than millisecond (it is essential for the experience). How can this be achieved? BTW, I'm new to LabView.

    I think on the use of network socket to get the message for both applications.

    I was wondering if there is a better way.

    Thank you.

    You do not say if two programs access the same material, but I guess not. Because if they did, you probably get conflicts when the two programs try to access the same material at the same time.

    In either case, the only really reliable way to ensure that your needs of< 1ms="" would="" be="" hardware="" triggering.="" one="" hardware="" unit="" is="" programmed="" to="" provide="" a="" hardware="" trigger,="" typically="" a="" digital="" signal="" and="" the="" other="" is="" programmed="" previous="" to="" the="" desired="" start="" point,="" to="" wait="" for="" that="" trigger="" and="" start="" automatically="" when="" it="" is="" received.="" if="" both="" hardware="" units="" are="" ni="" daq="" cards="" you="" can="" do="" that="" fairly="" easily="" using="" the="" rtsi="" bus="" or="" in="" case="" of="" pxi="" the="" pxi="" trigger="" lines.="" if="" they="" are="" different="" hardware="" then="" it="" can="" get="" more="" complicated="" to="">

Maybe you are looking for