Java NIO, ByteBuffers and Linksys router

I have a client server app/game that uses NIO for communication sending ByteBuffers. On a LAN with 5-8 users it runs great. On the internet, through a Linksys router, with one user, it has a blip. I get all my data transmissions except for one buffer. Whenever I chat the buffer contains a size, an int typeID and the encoded string for chat. This particular buffer never makes it to the client on the outside of the router. I have a port forwarded and regular tcp/ip java io sockets stuff works fine. As does al lof the other NIO buffer traffic for locational data, login in and out, etc... ANy thoughts??

But not sure what would be the performance of those clients?? when compared to Java NIO performance....Telnet isn't a high-performance protocol anyway. Don't worry about it. Use existing code. Get it working. Measure. If you have a performance issue, then worry, while at least you have something you can deploy. It won't be a problem. The router is there to route, not to talk high-speed telnet.

Similar Messages

  • I have one PC with a modem and linksys router #BEFW11S4 i...

    I have one PC with a modem and linksys router #BEFW11S4 installed. I have 3 other PC's which connect to it via Linksys wireless-G adapters. Things have been working just fine until recently when now at least twice a day my Pc's with the adapters lose connection with the router. Any suggestions?

    Open routers set up page ..... click status & see the firmware version ...... if required update ....download the latest firmware from http://www.linksys.com/download ........

  • Time Capsule and Linksys Router Issues

    The internet cable is connected to the WAN port and the Time Capsule is connected is to one of the ports of the Linksys router. I can successfully backup my MacPro and use the internet for Mail and Safari.
    I want to take advantage of the high speed ethernet performance of Time Capsule. However, I don't know if the Time Capsule is really faster than my Linksys router.  Where do I get this information? I suspect the Time Capsule is much faster because I just purchased the Time Capsule. The router is at least 5 years old.
    In spite my concern about the speeds of the Time Capsule and Linksys router, I tried to attach the Time capsule as recommended by Apple for a  "first time set up." It failed. The Time Capsule using the AirPort Utility cannot make a network connection. I reestablished the devices as given in paragraph one. WiFi runs again.

    Ethernet speed on your local network is determined by the slowest connected device which most likely will be the LinkSys router or your computer.

  • Java NIO locking and NTFS network resources

    Hi all - just ran into a really nasty situation and I was wondering if anyone else has hit it and might have some suggestions.
    Platform: JRE 1.4_02 on a Win XP machine
    The following test code locks a file, then copies it to another location using NIO.
    When I run it with source path on my local drives (C), it works fine. If I run it with source path on a network shared resource, it fails with an IOException with description 'Error performing inpage operation'.
    If I disable the lock immediately before the copy operation, it works fine.
    My conclusion is that there is something about the NIO locking implementation that prevents it from working properly with NTFS volumes on other hosts. Can this be right? I've found the following bug report:
    http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4774175
    but this seems like a huge problem that would prevent folks from using NIO in many, many applications. Maybe I'm wrong on something here...
    Anyway, here's the test code:
    import java.io.File;
    import java.io.FileOutputStream;
    import java.io.IOException;
    import java.io.RandomAccessFile;
    import java.nio.channels.FileChannel;
    import java.nio.channels.FileLock;
    * Created on May 28, 2004
    * (c) 2004 Trumpet, Inc.
    * @author kevin
    public class test {
         private void createFile(File f) throws IOException{
              FileOutputStream os = new FileOutputStream(f);
              for(int i = 0; i < 10; i++){
                   os.write(i);
              os.close();
         public test() {
              boolean testWithReleasingLockPriorToCopy = false;
              final File f1= new File("w:/temp/test2.lok");
              final File f2 = new File("w:/temp/test.lok");
              f1.delete();
              f2.delete();
              try {
                   createFile(f1);
                   RandomAccessFile raf1 = new RandomAccessFile(f1, "rw");
                   RandomAccessFile raf2 = new RandomAccessFile(f1, "rw");
                   FileChannel ch1 = raf1.getChannel();
                   FileChannel ch2 = raf2.getChannel();
                   FileLock flock1 = ch1.lock();
                  if (!f2.getParentFile().exists() && !f2.getParentFile().mkdirs())
                       throw new IOException("Unable to create directories for destination file '" + f2 + "'");
                  if (testWithReleasingLockPriorToCopy)
                       flock1.release();
                   ch1.transferTo(0, raf1.length(), ch2);
                   raf1.close();
                   raf2.close();
              } catch (Exception e) {
                   // TODO Auto-generated catch block
                   e.printStackTrace();
         public static void main(String[] args) {
              test t = new test();
    }Does anyone have any pointers here? I need to be able to exclusively lock a file on a network drive (preventing any other applications from opening it), then make a copy of it. I can't use regular stream operations, because the lock prevents them from working properly (it appears that, once you grab a file lock using NIO, the only way your application can use the file is via the NIO operations - using stream operations fails...).
    Thanks in advance for any help!
    - Kevin

    i've run into the same problem recently, channels working fine for local file locking, but when you turn to the network, they fail to accurately handle locks.
    i ended up writing a jni utility to ship with my java application that locks files using native windows calls.
    my .c file ends up looking something like this:
    JNIEXPORT jint JNICALL Java_Mapper_NativeUtils_LockFile
    (JNIEnv *env, jobject obj, jstring filename)
    const char* ntvFilename = (*env)->GetStringUTFChars(env, filename, 0);
    int retVal = (int)CreateFile
    ntvFilename
    , GENERIC_WRITE
    , FILE_SHARE_READ
    , 0
    , OPEN_EXISTING
    , FILE_FLAG_SEQUENTIAL_SCAN
    , 0
    //add code to throw java exceptions based on retVal
    if (retVal == (int)INVALID_HANDLE_VALUE)
    return retVal;
    (*env)->ReleaseStringUTFChars(env, filename, ntvFilename);
    return retVal;
    JNIEXPORT jboolean JNICALL Java_Mapper_NativeUtils_UnlockFile
    (JNIEnv *env, jobject obj, jint handle)
         CloseHandle((void *)handle);
    return 1;
    it's a little shy on the error checking side, but it provides support for network file locking that java seems to lack.

  • Verizon DSL, Westell 6100 Modem and Linksys router

    If anyone is having a hard time getting these three to work together to get on-line, I know your pain. I've spent the better part of two days trying to get these devices to talk to each other. After hours spent trying different combinations and little to no help from Verizon and Linksys I have finally gotten my DSL up and running through my Linksys router. I post this in hopes that someone doesn't spin their wheels like I have been doing over the past few days. Here's what I did to get them to work:
    1. Reset both the Linksys router and the Westell modem
    2. Unplug the router and the modem
    3. Connect an ethernet cable from your Apple to the Westell modem and power it back on
    4. Type 192.168.1.1 in the address bar of your browser of choice. The username should be "admin" (w/o the quotes) and password should be "password" (again no quotes)
    5. It will ask you to update your username and password
    6. Under the CONFIGURATION heading select VC CONFIGURATION and click on EDIT
    7. Make sure that both PROTOCOL and MODE are set to BRIDGE
    8. Click on SET VC and then click OK when asked if you want to reset for new configuration to take affect
    9. Once again power off the modem for about a minute then power it back up
    10. Login again with the login you created above and go to the STATUS/ABOUT column and write down the MAC address
    11. Set it to DHCP OFF and change the Private Lan Modem IP to 192.168.2.1. Write this down and keep it so you can access your modem in the future.
    12. Save the settings. You will lose communication with the Westell at this point. Once again, power down the modem for about a minute.
    13. Connect the ethernet cable from the modem into the Internet port on the Linksys router and then connect your Apple to the first ethernet spot
    14. Turn on both the Linksys router and the Westell modem
    15. With your browser (Safari or Firefox) type in 192.168.1.1. Under SETUP go to MAC ADDRESS CLONE and enter the MAC address you wrote down for your Westell modem earlier and then save the settings
    16. Make sure you are in DHCP mode and not PPPoE
    17. Save, exit, and you should be on-line
    That was a lot more difficult than it had to be. I certainly didn't get this from the support folks from Linksys or Verizon...a lot of trial and error and investigating on-line. I hope this saves you from the headaches I experienced.
    Dual 2.7 GHz PowerPC G5   Mac OS X (10.4.5)   Verizon DSL

    Feedback for Linksys:
    In the Linksys Help system "Easy Answers" there's the question "How can I set up a Linksys router with DSL Internet?" This is what I used to try and solve my Internet connection problem.
    The Answer says "Most DSL providers use Point-to-Point Protocol over Ethernet (PPPoE) ..." and goes on to explain how to set up the router for PPPoE. However, my service (AT&T/Yahoo high speed internet) uses DHCP. That meant I spent several frustrating hours trying to get it to work with PPPoE.
    The Answer would have been better if it first explained how to tell if you have PPPoE or DHCP (see the reply from vness above, it's an excellent explanation), and then linked to the appropriate setup instructions.
    Thanks for the help!!!!

  • Macbook and Linksys router

    i am having a strange problem. My macbook had no problem connecting to my linksys wireless g router. now it is. Set to automatic it isnt getting any ip info. I have to set it to manual and enter all the info manually to get it to work. It has a full wireless signal, and a pc on the same network set to automatic works fine. Linksys told me that it was a problem using IPv6 and that i need to change it to IPv4, but i never had to do it before and it worked for months. And when i go to another location, my work, i can connect to that wireless network with the automatic settings. My solution is to have two locations, one for work set to auto and one for home set on man. i am just wondering why its acting this way

    I'm also having trouble with my MacBook and my Linksys WRT54G since the last update...
    I've found that if I disable the password/encryption security it works fine - but if I have either WPA or WEP enabled, then I can only connect manually, and even then it doesn't get a proper IP address and I can't access the net, even though it shows me as connected with a good signal.
    So, for now, I've enabled the MAC address filter so that only my computers can access the wireless network. I'd rather have the WPA or WEP encryption, but it appears something about that update has made that not an option when using a Linksys router.
    G5 Dual 2Ghz; MacBook 2Ghz w/2GB RAM; 20GB iPod 3rd Gen; 40GB iPod Photo   Mac OS X (10.4.7)  

  • Troubles with timeout using java.nio.channels and non-blocking sockets

    Hello.
    I have a server application that employs java.nio.channels with non-blocking sockets.
    The server waits for connections. The client should connect and be first in sending data.
    Timeouts are significant! If client exceeds the allowed time to send data, the server should break the connection.
    The huge trouble I've discovered that I cannot control the timeout when client connects but remains silent.
    My code looks as follows:
    <pre>
    Selector oSel;
    SocketChannel oSockChan;
    Socket oSock;
    SelectionKey oSelKey;
    Iterator<SelectionKey> oItSelKeys;
    int iCurrState, iMask, iCount;
    iCurrState = INT_SERVER_WORKING;
    iMask = SelectionKey.OP_ACCEPT | SelectionKey.OP_CONNECT | SelectionKey.OP_READ | SelectionKey.OP_WRITE;
    while ( iCurrState == INT_SERVER_WORKING )
    try
    *// retrieving next action*
    iCount = oSel.select();
    if ( iCount > 0 )
    oItSelKeys = oSel.selectedKeys().iterator();
    while ( oItSelKeys.hasNext() )
    oSelKey = oItSelKeys.next();
    oItSelKeys.remove();
    if ( oSelKey.isValid() )
    switch ( oSelKey.readyOps() & iMask ) {
    case SelectionKey.OP_ACCEPT :
    oSockChan = oSSockChan.accept();
    oSockChan.configureBlocking(false);
    oSock = oSockChan.socket();
    oSock.setKeepAlive(true);
    oSockChan.register(oSel,SelectionKey.OP_READ,new MyPacket(oSock.getInetAddress(),oSock.getPort()));
    break;
    case SelectionKey.OP_READ :
    oSelKey.interestOps(0);
    ((MyPacket) oSelKey.attachment()).inRequest(); *// preparing request*
    this.getReader().add(oSelKey); *// sending key to reading thread*
    break;
    case SelectionKey.OP_WRITE :
    oSelKey.interestOps(0);
    ((MyRequest) oSelKey.attachment()).inResponse(); *// preparing response*
    this.getWriter().add(oSelKey); *// sending key to writing thread*
    break;
    case SelectionKey.OP_CONNECT :
    default :
    *// nothing to do*
    catch ( IOException oExcept )
    *// do some actions*
    </pre>
    Timeouts are easily controlled by reading and writing threads (see OP_READ and OP_WRITE ).
    But when a client just connects without consequent data send, the state of this connection remains as OP_ACCEPT. The connection remains open for arbitrarily large time and I cannot control it!
    Please help with idea how can I terminate such connections!

    How can I process the keys that weren't selected at the bottom of the loop? Should I use the method keys() ?Yes. Form a new set from keys() and removeAll(selectedKeys()). Do that before you process selectedKeys().
    And the second moment: as I understood a single key may contain several operations simultaneously? Thus I should use several if's (but not if/else 'cause it's the equivalent of switch ... case ).If there is anything unclear about 'your switch statement is invalid. You need an if/else chain' I fail to see what it is. Try reading it again. And if several ifs were really the equivalent of "switch ... case", there wouldn't be a problem in the first place. They're not, and there is.

  • Airport card and linksys router?

    I just had an Airport Wireless card installed for my parents' ibook g4. I bought a Linksys wireless router for them, b/c we have one (for PC desktop and laptop) and have had good luck with it. I think the two times I've had to contact Linksys via phone or live chat I got quick responses and good service.
    Enter adding the Mac to the equation. When I bought the router for my parents, I mentioned we'd be using it with a Mac and the guy at the store said some people choose Netgear routers over the Linksys b/c they're RTG, but with some older Macs (theirs is an iBook G4 from a few years ago) you have to DL something to get the Mac to see the Linksys network.
    Somehow the Mac doesn't see my wireless network and I can't figure out how to add it. I had a useless hour-long chat session with someone at Linksys--no resolution. Can I actually get a Mac to work with Linksys or should I give up the ship and go get a Netgear router or airport base?
    I plan to set up their wireless network at their beach house, so there will be a Mac and PCs using it and then putting in their home when they return in the fall.
    TIA!

    scatterall, Welcome to the discussion area!
    The iBook G4's AirPort Extreme card will allow you to connect to any standard 802.11b/g network including one created by a Linksys router.
    Compare the antenna wire connection to the AirPort Extreme card with the photos in KB 108039, Properly attaching the antenna on an AirPort Extreme Card.
    Do you have the Linksys configured to broadcast the SSID? If not, enable the SSID broadcast. This is a futile attempt at security since the SSID is still broadcast between the base station and any connected clients.
    If you can't or won't enable SSID broadcast, on the iBook G4 you will need to go to the AirPort menu, select "Other...", and enter the network name and password (if wireless encryption is enabled).

  • Time Capsule and Linksys router bridging two networks

    I have set up a Time Capsule on a small business network and have made use of its dual wifi to set up guest access to the internet separate from our private network. It defaults to IP address 192.168.1.1 which conflicts with a computer that must be assigned that address so I have given it the IP address 192.168.0.1. I was hoping to bridge between the 192.168.0.x and 192.168.1.x networks using a Linksys BEFSR41 router. I have been able to get internet access from the 192.168.1.x network and port forward to our Windows e-mail server but can't get individual computers to see each other from one network to the other.
    Can I set the Time Capsule IP to anything other than x.x.x.1 or alternately use it or another router to bridge two different networks?

    Ethernet speed on your local network is determined by the slowest connected device which most likely will be the LinkSys router or your computer.

  • Airport Express and Linksys Router Problem

    I have a Linksys wireless router through which I connect to the internet using my Macbook Pro without any difficulties. I recently purchased an Airport Express unit in order to connect to my stereo and play music using Itunes. However, I seem to be unable to set up the Airport Express as the Airpor Utility does not seem to be able to find it. I tried connecting it to the router using an ethernet cable and this did not seem to solve the problem? Does anyone have any recommendations to solve this problem?

    Thank you for the suggestion. That allowed me to see it to configure it but once I disconnect it to restart it I the network cannot find it and it just blinks orange. I am guessing that it is because I have set the network security incorrectly. I set it at WEP 128. How do I check to see how the Linksys is configured? Or do you think it might be something else? Thank you.

  • K8N Neo2 Plat NICs and Linksys Router

    I have a Linksys BEFSR41 4 port Router with the latest Firmware and when I connect either RealTek or Nforce onboard Network to it, the Red DIAG LED on the router goes on every few seconds. Seems like it floods my router. I can still view webpages when this is going on but when the Red DIAG Led comes on, my router freeses up. By that I mean all traveling data is haulted until DIAG LED turns off. One thing I noticed is that the activity light to the NIC is constantly flashing. This also only happens when the computer with the K8N Neo2 is the only one connected to the router. If I disconnect the This computer then it stops flooding.
    Specs:
    Athlon 64 3500+
    K8N Neo2 PLatinum Ver.1 Bios Version 1.2
    2 X 512MB Corsair DDR400 2-2-2-5 timings
    eVGA Geforce 6800GT
    Western Digital Raptor 2 74.3GB 10,000
    Windows XP Pro
    Things I tried:
    1. Installed latest Router Firmware. Still floods router
    2. Installed Linksys PCI LNE100TX NIC. Connect that Nic to router with other onboard NICs disabled in the Bios and still floods. I've used this nic in other computer with no issues when connected to router.
    3. Tried different Patch network Cables. Still Floods
    4. Connected NIC directly to Cable Modem and Activity LED constantly Flashing. Internet works fine though when connected straight to modem.
    5. Disabled 1394 Net adapter in "Network Connections". still flood.
    6. I tried flow control option thats located under the Advanced Tab in NIC properties on both onboard NICs. Still floods.
    Anyone else have this Router/Motherboard and have issues like this?
    Any other suggestions?
    THanks for everyones help!!

    I have the older BEFSR41 router. Not the newer version 2 I believe it is.
    Anyone have this older router with the same motherboard and have any issues?

  • HT4260 I have an AirPort Extreme and a linksys router. What is the best way to get 6-8 wired connections with ac speeds?

    I have an AirPort Extreme and a linksys router. What is the best way to get 6-8 wired connections with ac speeds?
    Appreciate your assistance.

    The answer depends on whether the AirPort Extreme is your main router....or...the Linksys device is your main router.
    In either case, the two devices must connect together using a wired Ethernet connection using CAT5e or CAT6 cabling.
    Any version of the AirPort Extreme produced within the last 5 years will have Gigabit Ethernet ports. In order to get the same speeds from the Linksys router, it will also need to be Gigabit Ethernet capable.
    If you need additional Ethernet ports, you will need to add a Gigabit Ethernet switch to either the AirPort Extreme or Linksys router.
    It is assumed that your other devices connecting to the AirPort Extreme and Linksys router will also have Gigabit Ethernet capability.
    Not sure why you mention "ac" speeds in your post. This relates to wireless connections, not wired.

  • Java.nio package

    Is there a good tutorial somewhere which explain in depth the new I/O package in JDK 1.4 java.nio?

    And there is the JavaWorld article at:
    http://www.javaworld.com/javaworld/jw-09-2001/jw-0907-merlin.html
    but the example code they give is a little broken, and
    the article is also a little confusing. But it can help a little.
    I have also started some threads on these forums about the bugs in that article.

  • DSL Modem + Linksys Router

    Hello
    I have DSL Modem connected with linksys router and linksys router is connected with normal switch all our workstations are directly connected with switch. now let me tell you the configuration also.
    DSL MODEM
    ISP DEDICATED IP : ***.***.**.**
    LOCAL IP : 192.168.1.1
    DHCP ENABLED
    LINKSYSROUTER
    DHCP ENABLED
    LOCAL IP: 192.168.2.1
    LINK IP: 192.168.1.5 (Assigned by DSL MODEM DHCP)
    DNS: Assigned by DSL Modem
    WORKSTATION
    LOCAL IP: Assigned by Linksys router for e.g 192.168.2.100
    Now my problem is that after every one hour we get disconnect from the router when we ping the router 192.168.2.1 from workstation it says "Request timed out" and when we give a power cycle to router its repling by ping command, I am also using WLAN on this router.

    Why so difficult?
    DSL MODEM
    ISP DEDICATED IP : ***.***.**.**
    LOCAL IP : 192.168.1.1
    DHCP ENABLED
    set dhcp range from .50 to .200
    LINKSYSROUTER
    DHCP disabled
    LOCAL IP: 192.168.1.2
    LINK IP: not used, only use the router side(wan=empty)
    DNS: fixed to 192.168.1.1
    WORKSTATION
    LOCAL IP: Assigned by DSL for e.g 192.168.1.50...200
    You might need to add a static LAN route on the linksys like
    192.168.1.0 -> 192.168.1.1 (mask 255.255.255.0)
    Message Edited by linkwpw on 04-09-200704:57 AM

  • My HCL Laptop Hang When i use LINKSYS ROUTER WRT300N

    LINKSYS,
    I think you help me to solve my problem, i am using HCL Notebook P7910, And LINKSYS ROUTER WRT300N (V.1, Latest Firmware).
    Problem is when i use through LAN cable then working Fine but when i use THROUGH WI-FI then my laptop HANG.
    I also Contact with both coustomer cares, but problem not solved.
    what can i do both products are in warranty , warranty expire in next 1 month.

    Try these settings:
    Radio Band – 40
    Wide Channel – 6
    Standard Channel – 11

Maybe you are looking for

  • What is going on with sign in?

    It seems my Apple ID is not working on some parts of the site. Example, Apple Store. When I tried to sign into iTunes from my iPhone it rejects the Apple ID. On my mac--- I can get into discussions. I could not do that with my Apple ID at work just a

  • Intel iMac shutting off suddenly, not coming back for hours

    Hello, Last night my iMac suddenly shut off; I tried for about twenty minutes to turn it back on (I tried the power button, unplugging and replugging, changing outlets...), then gave up. This morning I tried it and it worked just fine, but after seve

  • HP Pavilion dv9723cl CD/DVD not dectecting with Windows 7

    I upgraded my Laptop HP Pavilion dv9723cl to windows 7 and my cd/dvd could not be dectected. It was working fine after like 2 weeks the icon was gone and it won't play anymore. I tried everything to fix it. I even went to regedit and deleted the Lowe

  • PlayBook Power Charger

    After three months, the Charger that came with my playbook stopped charging.  I can use a different device and it works fine, ie the usb cable to my PC. Has anyone else had the charger fail?  What was your course of action?

  • Frozen Screen / Battery Power not Depleting

    HELP! It is completely frozen - - back light on, playlist screen, Matthew Sweet playlist to be exact. I have tried all the 'R's - - and the updater/restore function won't work as it does not see my iPod being conncected to the computer (and yes, I al