Trying to get simple UDP Server to work

Hello
I am trying to get a simple UDP Server to work. I have written the Server and a Client and upto a point the program works. I can make a request from the client and the Server sees this and sends its own response. The problem is the client doesn't seem to receive this response. The error I get is 'java.net.SocketTimeoutException: Receive timed out'.
Below is the code for the Server;
        while (true) {
            try {
                for (i = 0; i < sendBuffer.length; i++)
                    sendBuffer[i] = 0;
                for (i = 0; i < receiveBuffer.length; i++)
                    receiveBuffer[i] = 0;
                serverSocket.receive(receivePacket);
                telemetryRequest = new String(receivePacket.getData(), 0, receivePacket.getLength());
                jTextFieldServerStatus.setText(telemetryRequest);
                receivePacket.setLength(receiveBuffer.length);
                sendTelemetry = new String("airspeed=" + Math.round(Float.valueOf((airspeed))));
                sendBuffer = sendTelemetry.getBytes("ASCII");
                sendPacket = new DatagramPacket(sendBuffer, sendBuffer.length, clientIPAddress, clientPort);
                sendPacket.setData(sendBuffer, 0, sendBuffer.length);
                serverSocket.send(sendPacket);
            } catch (IOException e) {
                jTextFieldServerStatus.setText("Error on server socket");
                return;
        }I have tested the Client against another UDP Server and this works, so I believe it is something in my Server code causing the problem.
If anyone has a solution to this problem I would really appreicate their help.
Regards
Gary

Cross post:
http://forum.java.sun.com/thread.jspa?threadID=792481&messageID=4503960#4503960

Similar Messages

  • TS4363 trying to get exchange mail server to work on my Mac.

    What is the External server supposed to be? It works when it wants to and then I can go days with no emails, although I am still getting them to my ipad and iphone

    Mail and Exchange can be a bit iffy, but this is usually a problem with the Exchange server. Mail on the Mac uses a different method of communicating with the Exchange server (Exchange Web Services) than do iOS devices (which use ActiveSync), so your Exchange server may be having problems with EWS. I'd suggest you first discuss this with the support resources for your email provider before you spend a lot of time spinning your wheels trying to sort things out on your end.
    As a quick test, you can try this Microsoft tool:
    https://testconnectivity.microsoft.com
    and see what it reports re. EWS connectivity to your server.
    Regards.

  • Trying to get simple slide show to work.

    Can anyone tell me why this simple slide show isn't working on the left side of my page? The black and white image should be changing and showing two other images every 2.5 seconds.
    http://friendsoflafayette.org/andreas01_orig/index.html
    Thanks,
    John

    Assuming you're following these steps
    http://www.javascriptkit.com/howto/show2.shtml
    You seem to have omitted the name attribute in the <img> tag described in Step 3.
    I'm still not sure if that fixes it but see how you go.

  • I am trying to get this java program to work

    I need your help, I am trying to get this java program to work. The program is long and massive, but I got stuck in the last point where the program checks if there are a double quotes or a comma in a string.
    The string is an URL retrieved from XML files (this is already done).
    There are 4 conditions:
    Case 1
    =====
    The URL string is of invalid format and contains no commas (,) and no double quotes (").
    Make no changes to the URL string.
    Case 2
    =====
    The URL string is of invalid format and contains 1 or more double quotes (") but no commas.
    Make no changes to the URL string.
    Case 3
    =====
    The URL string is of invalid format and contains 1 or more commas (,) but no double quotes.
    Modify the URL string so that it starts and ends with a double quote (").
    Case 4
    =====
    The URL string is of invalid format and contains 1 or more double quotes (") and one or more commas (,).
    Modify the URL string so that every double quote (") becomes a double double quote (""), and so that it starts and ends with a double quote (").
    ======
    then write the modified URL string to the CSV file.
    ======
    Examples:
    1. hello ---> hello
    2. hello "big" world ---> hello "big" world
    3. hello, world ---> "hello, world"
    4. hello "big,big" world ---> "hello ""big,big"" world"

    You can do the searching with String.indexOf() and then you can make replacements (like " with "") with String.replaceAll().
    As for adding leading and trailing ", that could be done with simple concatenation.

  • Hi there, I am trying to connect to my server at work from home using a vpn connection. It connects fine and the time ticks along, but when i click go - connect to server, it comes up with connection failed. Please help!

    Hi there, I am trying to connect to my server at work from home using a vpn connection. It connects fine and the time ticks along, but when i click go - connect to server, it comes up with connection failed. Please help!

    ... when i click go - connect to server, it comes up with connection failed.
    If you're trying to connect to a Bonjour server on the remote network, that won't work over a layer 3 VPN. Use something like Hamachi or one of the SSH-tunnelling Bonjour proxy apps for that.

  • Trying to get a WRT54GX2 wireless router working with a W...

    Trying to get a WRT54GX2 wireless router working with a WPC54G wireless card. The laptop and desktop both will access the Internet and work when hardwired through the router's Ethernet ports. When trying to access wireless, the Laptop shows to be connected to the router and also to Internet, but Internet Explorer can not access any websites.  Suggestions? Thanks.

    what ip address does the laptop get ?? ensure that the laptop is not set for a static ip add....and it gets an ip add from the router ..

  • Trying to get a code walkthrough to work - Bing Ads Api C# Web App

    Hi,
    I'm trying to get the C# Web App code walkthrough to work.  I went through the steps written out, and pasted in the Client ID, Client Secret, RedirectionUri, and DeveloperToken values.  When I run the app, it sends me to the redirection URI, with
    "?code=" and a 36-character code added onto the address.  Could you tell me why this is happening, and what I might need to do to get this working?
    Thanks,
    Mike

    Hi Mike.
    The current example assumes that you set the RedirectionUri to index.chtml, which admittedly isn't robust enough. We plan to update it. Typically as you are probably attempting, the callback after the user provides credentials would redirect
    to a page other than index.chtml e.g. callback.chtml.
    Short term solution is that you can update the RedirectionUri to either "YourSite\" or "YourSite\index.chtml", and the existing sample should run. Otherwise you can define a new callback page that handles the "?code" fragment
    e.g. as follows:
    // If the current HTTP request is a callback from the Microsoft Account authorization server,
    // use the current request url containing authorization code to request new access and refresh tokens
    if (Request["code"] != null)
    await authorization.RequestAccessAndRefreshTokensAsync(Request.Url);
    // Save the authorization object in a session for future requests.
    Session["auth"] = authorization;
    return await CallBingAdsServices((OAuthWebAuthCodeGrant)Session["auth"]);
    Does this help? Please let me know if you have any other questions.
    Best regards,
    Eric

  • Can't get Godaddy outgoing server to work in Mail - OK in Outlook

    No matter what I try, I just cannot get the Godaddy outgoing server to work in Mail, but it works OK in Outlook for Mac which I don't really want to use if I can avoid it.
    I've tried all my 3 accounts and none of them work with sending.  All Ok receiving.
    Tried smtpout.secureserver.net with and without SSL, and with all sorts of ports 80, 3535, etc.
    Nothing works.
    Can anyone suggest any solution or more in depth troubleshooting methods.  I feel it's some security issue which Outlook seems to have more settings for.
    Thanks.

    Eric Root wrote:
    Copy the line below.
    ~/Library/Containers/com.apple.mail
    While holding down the option key, select Go/Go To Folder from the Finder menu bar. Paste the line into the window. You won’t see it.
    Just for clarification for the OP these are two different approaches to get to the same file.
    1.)While holding down the option key, >>Shows the hidden  users Library (~/Library.)
    or
    2.) select Finder>Go>Go To Folder from the Finder menu bar. Paste the line into the window
    ~/Library/Containers/com.apple.mail
    Using the Go to Folder option will take you directly to the file itself in your user Library (~/Library,) no option key necessary.
    Eric Root wrote:
    Move the folder com.apple.mail to your desktop. You must move the entire folder, not just the contents.
    AND if you are recommending moving the entire folder you are better off going to the /Container:
    ~/Library/Containers/

  • So sick of trying to get iTunes 8.2 to work on Vista - 7 days of ****

    After downloading £50+ worth of new music/audiobooks and tv shows last week, innocently clicked on 'upgrade to 8.2'; (yes I backed up my Library and hard disk first); result, the last 7 days of **** trying to get iTunes and my iPhone to sync. I'm so sick of this bloody iPhone, iTunes and Vista, if I could go out and purchase a replacement to iPhone and iTunes I would without a second thought.
    I have tried absolutely everything posted on apple.com/itunes/support in the last 7 days - must have spent a good 4-5 hours a day over the last 7 days trying to fix this sodding fault.
    At this point, I'm considering going back to CDs, and the simplicity of just putting a CD on and playing it. It seems but a far away, simple approach to listening to music, compared to the sodding **** of trying to get iTunes to work on my Vista Laptop.
    So ****** off I'm thinking of getting rid of my iPhone (and yes I'm at the end of my contract) and going for anything that is Non-Apple.
    Anyone else had this delightful experience with iTunes 8.1 and 8.2?

    Read the iTouch forums and other iPhone forums... this is a big issue and a known bug. Apple contacted me right after I posted my issue. I downloaded it when it was released. My fix tonight was to downgrade to iTunes 8.1. This works for sure, so this is the only fix that I know truly works.

  • Help ! Trying to get PDF Prep Tool to work

    Help... Iam trying to get the PDF PRep Tool from www.pdf-tools.com to work. I get a nativ error (se belove) when trying the first included demo.
    Has anyone worked the PDF Prep Tool, and maybe can help out ?
    My Specs:
    Windows 2000 Server sp 3
    JDK 1.4.1_01
    My Error:
    An unexpected exception has been detected in native code outside the VM.
    Unexpected Signal : EXCEPTION_ACCESS_VIOLATION occurred at PC=0x1004A0DC
    Function=[Unknown.]
    Library=C:\WINNTFW1\system32\pdprep32.dll
    NOTE: We are unable to locate the function name symbol for the error
    just occurred. Please refer to release documentation for possible
    reason and solutions.
    Current Java thread:
         at com.glance.pdf.pt.PTLib.PDocClose(Native Method)
         at com.glance.pdf.pt.PTDoc.close(PTDoc.java:209)
         at com.glance.pdf.engine.Generator.genPass(Generator.java:672)
         at com.glance.pdf.engine.Generator.generate(Generator.java:413)
         at FirstStep.main(FirstStep.java:60)
    Dynamic libraries:
    0x00400000 - 0x00406000      C:\Program\J2SDK_SE\bin\javaw.exe
    0x77F80000 - 0x77FFB000      C:\WINNTFW1\System32\ntdll.dll
    0x77DB0000 - 0x77E0B000      C:\WINNTFW1\system32\ADVAPI32.dll
    0x77E80000 - 0x77F31000      C:\WINNTFW1\system32\KERNEL32.dll
    0x77D30000 - 0x77DA1000      C:\WINNTFW1\system32\RPCRT4.dll
    0x77E10000 - 0x77E6F000      C:\WINNTFW1\system32\USER32.dll
    0x77F40000 - 0x77F79000      C:\WINNTFW1\system32\GDI32.dll
    0x78000000 - 0x78046000      C:\WINNTFW1\system32\MSVCRT.dll
    0x75E60000 - 0x75E7A000      C:\WINNTFW1\System32\IMM32.DLL
    0x6CA60000 - 0x6CA68000      C:\WINNTFW1\System32\LPK.DLL
    0x66650000 - 0x666A4000      C:\WINNTFW1\System32\USP10.dll
    0x6D330000 - 0x6D45A000      C:\Program\J2SDK_SE\jre\bin\client\jvm.dll
    0x77570000 - 0x775A0000      C:\WINNTFW1\System32\WINMM.dll
    0x6D1D0000 - 0x6D1D7000      C:\Program\J2SDK_SE\jre\bin\hpi.dll
    0x6D300000 - 0x6D30D000      C:\Program\J2SDK_SE\jre\bin\verify.dll
    0x6D210000 - 0x6D229000      C:\Program\J2SDK_SE\jre\bin\java.dll
    0x6D320000 - 0x6D32D000      C:\Program\J2SDK_SE\jre\bin\zip.dll
    0x10000000 - 0x1008F000      C:\WINNTFW1\system32\pdprep32.dll
    0x782F0000 - 0x78534000      C:\WINNTFW1\system32\SHELL32.dll
    0x77C70000 - 0x77CBA000      C:\WINNTFW1\system32\SHLWAPI.dll
    0x77B50000 - 0x77BD9000      C:\WINNTFW1\system32\COMCTL32.dll
    0x77A50000 - 0x77B45000      C:\WINNTFW1\system32\ole32.dll
    0x779B0000 - 0x77A4B000      C:\WINNTFW1\system32\OLEAUT32.dll
    0x77920000 - 0x77943000      C:\WINNTFW1\system32\imagehlp.dll
    0x72A00000 - 0x72A2D000      C:\WINNTFW1\system32\DBGHELP.dll
    0x690A0000 - 0x690AB000      C:\WINNTFW1\System32\PSAPI.DLL
    Local Time = Mon Jan 13 15:13:01 2003
    Elapsed Time = 2
    # The exception above was detected in native code outside the VM
    # Java VM: Java HotSpot(TM) Client VM (1.4.1_01-b01 mixed mode)
    # An error report file has been saved as hs_err_pid1964.log.
    # Please refer to the file for further information.

    Actually it is e-doc assembler im trying to get to work...:-)
    (Is there an edit function in these forums ?)
    /Ruben

  • Trying to get dwm, urxvt, transparency to work nicely together

    New Arch user here, great distribution.
    I've been trying to set up dwm with the Monaco font (great monospace/ttf font) and transparency. As you know, dwm launches uxterm by default as a new terminal. I wanted something with transparency, so I tried urxvt and tried to get it to use "fake" transparency (I could try real transparency, but when I launch xcompmgr I get a plethora of streaming error messages, so I guess I'll have the fake stuff). My ~.Xresources file looks like so:
    ! URxvt*font: Monaco
    URxvt*background: black
    URxvt*foreground: white
    URxvt*termName: rxvt
    URxvt*multichar_encoding: utf-8
    URxvt*transparent: true
    URxvt*tintColor: white
    URxvt*shading: 50
    URxvt*loginShell: true
    URxvt*scrollBar: false
    URxvt*scrollKey: true
    URxvt*saveLines: 3000
    I grabbed this somewhere from the net. I've commented out the font, because its another issue and I'll address it below. After saving this, and running xrdb -load ~/.Xresources, I try launching urxvt. The colors work fine (background and foreground), but I can't seem to get the transparency working at all. Instead its just a solid color.
    As for the font, I installed Monaco from the arch repos. I tried using xlsfonts to get the "name" of the font, but that showed up nothing. Can urxvt use ttf fonts?
    Thanks for your help, I'll post anything else anyone needs.
    Last edited by maxmackie (2012-05-29 23:41:54)

    JackH79 wrote:
    This will probably help (it will probably help with your font problems as well). See what it says about using shading and tintColor at the same time.
    Also, just for future reference, please use Code tags for posting file content or terminal output.
    Like this:
    [code]Some text[/code]
    Thanks for the link. I must have skimmed over too quickly last time. I got the font working, awesome how the wiki uses the font I want as an example For the transparency however, no dice. I tried using either only shading or tint, but both of them failed. Just to be 100% certain, I don't need xcompmgr running or anything for this to work right?
    Trilby wrote:I'm not sure where dwm comes into play here, but I will give you one of my own grievances: I much prefer "real" transparency because with psuedo-transparency, whenever the layout changes, there seems to be a good bit of lag between to windows changing shape and the pseudo-background being redrawn.  It's ugly as hell - so I use true transparency.  I'm still working, however, on a dwm patch to "hide other" windows in monocle mode, because as is, a true transparent terminal in monocle mode shows other windows below it ... also ugly as hell.
    The only saving grace is that I never really use terminals in monocle mode - thats just for my web browser on occasion.
    As for the problem at hand, I second Jack's point.  Remove one of those and try again.
    I figured I'd mention dwm seeing as they mention transparency issues out of box (ie, none). I thought maybe running dwm required me to have an extra daemon running or something... I do agree that true transparency would be much nicer, but I'm running into big issues with xcompmgr. Running from shell dumps an endless stream of "error 163: BadPicture request 149 minor 8 serial xxxxx" and running it straight from dmenu results in ugly transparency between different tags in dwm (I have a terminal open on tag 1 and firefox open on tag 2, I can see firefox through the terminal on tag 1). Admittedly, I haven't read into anything regarding xcompmgr so these could all be trivial issues.
    jasonwryan wrote:Welcome to the boards Max. What took you so long?
    Hey Jason. Well, a couple years back I saw your awesome screenshot of dwm and decided to switch from KDE to it. I guess recently I felt like going the whole way and running Arch. I loved getting everything up and running manually (nothing like installing an OS and being given only a simple terminal ). Thanks for the welcome.

  • Trying to get HD-DVD drive to work on Satellite P100-463

    Hi everybody.
    I bought this baby on the weekend and since I am struggeling trying to get HD-DVD to work on it. I added the xbox 360 HD_DVD drive but the Power DVD Software Advisor keeps telling that the graphic card 9Geforce Go 7900) drivers need to be updated in order to play HD-DVD content. Now, there is no newer driver available as the one installed (84.0?)
    Can anybody please advise if the card supports hdcp protection anyways? Maybe my problem has another source.
    Thanks for advice.

    Wait do you use the drive designed for the Xbox in the Satellite P100?
    Hmm, Im surprised that this device is compatible with the Toshiba notebook.
    Anyway, as far as I know you need a special DVD software player to play and watch HD-DVD on the notebook.
    A simple WinDVD does not support the new HD-DVDs.
    By the way: I know one Toshiba model that was delivered with the HD_DVD drive.
    It was a Qosmio G30 DVD HD Model.
    I found in the driver download section on the Toshiba site a new update of Nvidia GeForce Go7600 graphic card driver Version 8.3.2.7
    But I dont know if its compatible with you card...

  • After down loading the latest up dates, I am now getting a pop up that says can't get e mail server stopped working, how can I stop this pop u.

    After the latest ISO 8.3 down  load to my, I now keep getting a pop up saying can't gette mail server stopped working, I am still receiving e mail so I know it working, it's just annoying having to cancel this pop up, any ideas how to stop this pop up.

    Pull your mail plist from ~/Library/Preferences

  • Getting the NLS server to work in Direct Access

    Hello,
    Need help on getting a NLS server working.   It works when I use the DA server as a NLS server.  Soon as I move it to another server, everything breaks.   I connect internally and no host names are accessible.   "netsh dns show state"
    says the machine location is on the outside corporate network.    So what gives?
    The NLS server has a web certificate with the common name of an internal dns entry, example da-nls.company.lan.     It has an https 443 binding.    I have no issues hitting it from another machine (non DA client).     The entry
    is not accessible from the outside network.   Step 3 DA configuration validates the url.   Step 3 also has a DNS exception for da-nls.company.lan (no address).
    So I guess I'm not sure where I am going wrong.   Anyone have any ideas?
    Thanks

    Hi,
    Do you have a Default.html file defined and content in the file on the new NLS server?
    I have seen this problem before may moons ago.
    this article may help
    http://blogs.technet.com/b/tomshinder/archive/2010/04/06/when-good-network-location-servers-go-bad-preparing-against-nls-failure.aspx
    Regards, Rmknight

  • Trying to get a code walkthrough to work - Bing Ads Api C# Desktop App

    Hi,
    I'm trying to get the Bing Ads API Desktop App Walkthrough working.  When I run it where it says to run, I get an error saying "Uri passed doesn't contain code param..."
    All I've done to the copied and pasted code was input ClientId and DeveloperToken in the first part of the MainWindow class.
    Do you have any idea what could be causing this?
    https://msdn.microsoft.com/en-US/library/bing-ads-net-walkthrough-desktop-application.aspx
    Thanks,
    Mike

    I am able to repro the issue by using the ClientId of a web application.
    The proposed solution is to register an application as a desktop or mobile application, in order to use that example. Running Fiddler you can capture the traffic e.g. as follows:
    https://login.live.com/oauth20_desktop.srf?error=invalid_request&error_description=The%20provided%20value%20for%20the%20input%20parameter%20'redirect_uri'%20is%20not%20valid.%20The%20client%20application%20must%20be%20marked%20as%20'mobile'%2c%20or%20the%20value%20must%20be%20an%20absolute%20URL%20which%20matches%20the%20registered%20redirect%20URI.&lc=1033
    It seems the 'Uri' error message is thrown by the SDK because it tries to get access and refresh tokens with the URL above instead of the expected on with 'code'. We will take a look at the SDK and make sure the right error message is being relayed. 
    By the way if you want to use a web application (as it sounds like you may have already registered one), try Walkthrough: Bing Ads Web Application in C#.
     Please let me know if I can help with any other questions. 
    I hope this helps!
    Eric

Maybe you are looking for

  • Standard Process's

    Hi, Are there any Oracle documents listing the standard process's for each module? Or Process flow diagrams? Many thanks

  • Check SQL 2008 standard or enterprise

    Hi, how can I check sql 2008 edition except running query on sql browser? Or can I check this information from registry?

  • Create procedure in different scheam

    Hi Team, I have a requirement like i have 2 schema like Schema A and Schema B in Schema A have procedure like SP_EMP_DETAILS  this procedure need to create in Schema B as will present we are using manual process copy the script from Schema A and past

  • Datagrid and Labels

    I am using this example found here: http://www.flash-creations.com/notes/servercomm_database.php I am having problems with labels and a datagrid. When an item is selected I would like for the Invoice number to appear in the label box/text box. Using

  • Cannot update indesign cc (error message  U44M1P34)

    cannot update indesign cc (error message  U44M1P34) .would you please help me. thank you .