Dialin Problem

I'm having a problem with PPP dropping connection. I have Solaris8 - (Intel) Everything is going fine then all of a sudden I get this "process_ipd_msg: interface ipdptp0 reports an error " message in the logs and it drops the line and reconnects. (I've included part of the log below)
This problem has been giving me problems for days. I've tried everything I can think of... Anyone have any ideas what is going on here or how I can fix it? How do I find where this "reports an error" is coming from? (ie what the error is)
Any help please.
Thanks,
Michael
Modem: USR 56K External
OS: SunOS krose 5.8 Generic_108529-05 i86pc i386 i86pc
12:01:09 054485 ipdptp0 ppp_diag: [ID 501754 kern.debug] SEND PPP ASYNC 57
Octets NB (AP) VJ_UNCOMP_TCP 45 00 00 34 a0 16 40 00 40
12:01:09 054486 ipdptp0 ppp_diag: [ID 947544 kern.debug] SEND PPP ASYNC 15
Octets NB (AP) VJ_COMP_TCP 50 0a 78 ac 71 75 69 74 0d 0a
12:01:10 054487 ipdptp0 ppp_diag: [ID 462543 kern.debug] RECEIVE PPP ASYNC
57 Octets NB (AP) VJ_UNCOMP_TCP 45 00 00 34 59 08 40 00
12:01:10 054488 ipdptp0 ppp_diag: [ID 697767 kern.debug] RECEIVE PPP ASYNC
72 Octets NB (AP) VJ_UNCOMP_TCP 45 00 00 43 59 09 40 00
12:01:10 054489 ipdptp0 ppp_diag: [ID 505786 kern.debug] SEND PPP ASYNC 57
Octets NB (AP) VJ_UNCOMP_TCP 45 00 00 34 a0 18 40 00 40
12:01:10 054490 ipdptp0 ppp_diag: [ID 946063 kern.debug] SEND PPP ASYNC 57
Octets NB (AP) IP_PROTO 45 00 00 34 a0 19 40 00 40 06 be
12:01:10 054491 ipdptp0 ppp_diag: [ID 546447 kern.debug] RECEIVE PPP ASYNC
57 Octets NB (AP) VJ_UNCOMP_TCP 45 00 00 34 59 0a 40 00
12:01:10 054492 ipdptp0 ppp_diag: [ID 349955 kern.debug] RECEIVE PPP ASYNC
57 Octets NB (AP) IP_PROTO 45 00 00 34 59 0b 40 00 fd 06
12:01:10 054493 ipdptp0 ppp_diag: [ID 589690 kern.debug] SEND PPP ASYNC 57
Octets NB (AP) VJ_UNCOMP_TCP 45 00 00 34 a0 1a 40 00 40
12:01:27 054494 ipdptp0 ppp_diag: [ID 791769 kern.debug] SEND PPP ASYNC 89
Octets (AP) IP_PROTO 45 00 00 54 84 bb 40 00 ff 01 36 c2
12:01:27 process_ipd_msg: interface ipdptp0 reports an error
12:01:27 disconnect: disconnected connection from ipdptp0
12:01:27 054495 ipdptp0 ppp_diag: [ID 221690 kern.debug] RECEIVE PPP ASYNC
27 Octets NB LCP Proto-REJ ID=07 LEN=22 Rej_proto=a234
12:01:27 054496 ipdptp0 ppp_diag: [ID 267406 kern.debug] SEND PPP ASYNC 9
Octets NB (A) IP_NCP Term-REQ ID=ef LEN=4
12:01:28 054497 ipdptp0 ppp_diag: [ID 203052 kern.debug] RECEIVE PPP ASYNC
89 Octets NB (AP) IP_PROTO 45 00 00 54 7e 9b 40 00 fd 01
12:01:28 054498 ipdptp0 ppp_diag: [ID 626626 kern.debug] RECEIVE PPP ASYNC 9
Octets NB (A) IP_NCP Term-ACK ID=ef LEN=4
12:01:28 054499 ipdptp0 ppp_diag: [ID 188677 kern.debug] SEND PPP ASYNC 9
Octets NB LCP Term-REQ ID=f0 LEN=4
12:01:31 054500 ipdptp0 ppp_diag: [ID 424189 kern.debug] SEND PPP ASYNC 9
Octets LCP Term-REQ ID=f1 LEN=4
12:01:34 054501 ipdptp0 ppp_diag: [ID 906425 kern.debug] SEND PPP ASYNC 9
Octets LCP Term-REQ ID=f2 LEN=4
12:01:34 054502 ipdptp0 ppp_diag: [ID 854706 kern.debug] RECEIVE {Unescaped
characters: 0a 0e } PPP ASYNC 69 Octets {BAD FCS} NB (A
12:01:34 054503 ipdptp0 ppp_diag: [ID 146661 kern.debug] RECEIVE PPP ASYNC 9
Octets NB LCP Term-REQ ID=f2 LEN=4
12:01:34 054504 ipdptp0 ppp_diag: [ID 882942 kern.debug] SEND PPP ASYNC 9
Octets NB LCP Term-ACK ID=f2 LEN=4
12:01:34 054505 ipdptp0 ppp_diag: [ID 776435 kern.debug] RECEIVE PPP ASYNC 9
Octets NB LCP Term-ACK ID=f2 LEN=4
12:01:34 054506 ipdptp0 ppp_diag: [ID 494070 kern.debug] PPP DIAG CLOSE
12:01:40 process_ipd_msg: ipdptp0 needs connection
conn(ppp)
Trying entry from '/etc/uucp/Systems' - device type ACU.
Device Type ACU wanted
Trying device entry 'cua/a' from '/etc/uucp/Devices'.
processdev: calling setdevcfg(ppp, ACU)
fd_mklock: ok

Hi,
On a similar occassion wherein I was trying to get Aux Port configured for Remote Dialin (for exec access and not for data) I tried almost 4 USR modems and everytime all the modems would get stuck at the handshake and never be able to complete the process.
However when I changed the modem to a simple make and model, it did work!
I guess its a problem with USR, have you ever tried with some other brand?
Kind Regards,
Wilson Samuel

Similar Messages

  • Modem dialin problem

    Hi,
    Hope you can help me with this, Im stuck.
    I have a 2500 router with several external modems (US Robotics 56k) connected over asynch cables. the line config is setup to autocommand telnet to a backend server.
    When I attempt to dial in, whichever modem answers, it seems to pick up the call, but then it drops almost immediately. The router log shows the same debug message each time:
    Jun 18 14:40:20.691: tty1: Modem: HANGUP->IDLE
    Jun 18 14:40:22.031: TTY1: Line reset by "Virtual Exec"
    Jun 18 14:40:22.031: TTY1: Modem: IDLE->HANGUP
    Jun 18 14:40:22.035: TTY1: destroy timer type 0
    Jun 18 14:40:22.035: TTY1: destroy timer type 1
    Jun 18 14:40:22.039: TTY1: destroy timer type 3
    Jun 18 14:40:22.039: TTY1: destroy timer type 4
    Jun 18 14:40:22.039: TTY1: destroy timer type 2
    Jun 18 14:40:22.727: TTY1: dropping DTR, hanging up
    Jun 18 14:40:22.727: tty1: Modem: HANGUP->IDLE
    Jun 18 14:40:24.764: TTY1: restoring DTR
    Jun 18 14:41:48.646: TTY1: Line reset by "Virtual Exec"
    router config:
    version 12.0
    service timestamps debug datetime msec
    service timestamps log datetime msec
    service password-encryption
    hostname R1
    logging buffered 50000 debugging
    aaa new-model
    aaa authentication login default local
    aaa authentication login no_user enable
    aaa authentication login noaut none
    aaa authentication login noprompt none
    enable secret 5 <removed>
    username test password 7 <removed>
    ip subnet-zero
    clock timezone GMT 0
    interface Ethernet0
    ip address x.x.x.x 255.255.255.0
    no ip directed-broadcast
    no ip mroute-cache
    interface Serial0
    no ip address
    no ip directed-broadcast
    no ip mroute-cache
    shutdown
    no fair-queue
    interface Serial1
    no ip address
    no ip directed-broadcast
    no ip mroute-cache
    shutdown
    ip classless
    ip route 0.0.0.0 0.0.0.0 x.x.x.x
    line con 0
    transport input none
    line 1
    no exec-banner
    exec-timeout 0 0
    no activation-character
    autoselect during-login
    session-limit 1
    no vacant-message
    login authentication noaut
    modem Dialin
    autocommand telnet x.x.x.x 3001 /noecho
    terminal-type edit
    exec-character-bits 8
    special-character-bits 8
    transport preferred telnet
    transport input all
    escape-character BREAK
    stopbits 1
    flowcontrol hardware
    line 2
    no exec-banner
    exec-timeout 0 0
    no activation-character
    autoselect during-login
    session-limit 1
    no vacant-message
    login authentication noaut
    modem Dialin
    autocommand telnet x.x.x.x 3000 /noecho
    terminal-type edit
    exec-character-bits 8
    special-character-bits 8
    transport preferred telnet
    transport input all
    escape-character BREAK
    telnet transparent
    stopbits 1
    flowcontrol hardware
    line aux 0
    login authentication no_user
    line vty 0 4
    password 7 <removed>
    end

    Hi,
    On a similar occassion wherein I was trying to get Aux Port configured for Remote Dialin (for exec access and not for data) I tried almost 4 USR modems and everytime all the modems would get stuck at the handshake and never be able to complete the process.
    However when I changed the modem to a simple make and model, it did work!
    I guess its a problem with USR, have you ever tried with some other brand?
    Kind Regards,
    Wilson Samuel

  • PVDM + Bri Dialin problem

    Hi everybody, i configured a c2811 with 2 bri and a pvdm module to accept incoming data connection via modem. Everything is ok except that after user is authenticated suddenly router disconnects connections with irregular time; it could be 2 mins, 5 mins etc... Anyone has an idea about? What it could be? Or if you see something wrong in configuration.
    Thanks in advance, Fabio.

    Please configure network-clock-select 1 bri 0/0/0 and network-clock-select 1 bri 0/0/1.
    Hope this helps, please rate post if it does!

  • Problem on connect to two servers with SSL

    Hey all!
    I've got a problem with connecting to two different servers via SSL in one Application. Every Connection works fine on its one via SSL.
    But if i try to initialize a new connection it fails every time.
    My thought is that the problem is the DriverManager. I'm not quite sure how this DriverManager works, but what i know is that it's a single-ton Class and with that maybe stores some parameters from the first connection which didn't get reloaded when trying to make a new connection.
    Here's the way i create the connection ..
        String host="best.host.ever";
        int port="3306";
        String MYSQL_URL="jdbc:mysql://"+this.host+":"+this.port+"/";
        DBName="db_foobar";
        sqlProps = new Properties();
        sqlProps.setProperty("user","foo");
        sqlProps.setProperty("password","bar");
        sqlProps.setProperty("zeroDateTimeBehavior","convertToNull");
        sqlProps.setProperty("useSSL","true");
        System.setProperty("javax.net.ssl.trustStore", trustStore);
        System.setProperty("javax.net.ssl.trustStorePassword", "trustpass");
        System.setProperty("javax.net.ssl.keyStore", keyStore);
        System.setProperty("javax.net.ssl.keyStorePassword", "keypass");
        System.setProperty("javax.net.debug","ssl");
        printDebug("[Konstruktor] : Connecting to "+MYSQL_URL);
        try {
             Class.forName("org.gjt.mm.mysql.Driver").newInstance();
             this.conn = DriverManager.getConnection(MYSQL_URL+DBName,sqlProps);     
            connectionCount++;
            initOK=true;
        //Catch stuff following...Is it possible that the System.properties i'm setting are only readed one time by the DriverManager (if it's readed by the DriverManager at all)?
    So when i initialize a new Object with different System.properties they may not get used again.
    Hopefully somebody has an explanation or a solution for this.
    Besides: If i launch the programm twice it's no problem to have to differen SSL connections at the same time.
    Thanks for reading and in advance for trying to help!

    Yep, it's the standard authentication failure message. (The error code is 1045).
    The Exception which is thrown is a SQLException with the message:
    Access denied for user 'username'@'p54BB743D.dip.t-dialin.net' (using password: YES)
    errorcode: 1045
    The code i'm using runs well with one connection and even with multiple connections as long as not more than one connection are using SSL.
    To explain:
    The user has the possibility to run the application with a user defined data-source (the connection). You can add a new connection and the application will then add a tabbed pane with the same gui but uses the other data source then.
    This runs fine with multiple connections (I managed to work on 3 differen intranet servers and 2 different servers online, one of them using SSL)
    So all together 5 Connections. Now i wanted to add a 6th server with SSL two and thats the point where it crashes. (Both SSL Servers run perfect on their own with my application - only both together doesnt work).
    About that: Class.forName, yes i'm using it every time when i make a new Connection. This is wrong? Could you explain why?
    Anyway thanks for your answers so far!
    Message was edited by:
    Hotkey_ger

  • Dialin conferencing number on dedicated meeting space

    Hi all,
    when every user on my Lync Server 2013 organization create a scheduled meeting on Outlook addin with
    option: My dedicated meeting space (less secure) and send invitation have a problem with DialIn Conferencing number.
    The voice phone message is: Meeting ID not exist.
    With option: A new meeting space (I control permissions) every dialin features work fine.
    In dedicated meeting space the meeting it's not present on Web Scheduler but all meeting features work fine exept dialin connection.
    The question is: is there my fault configuration or is this by design?
    Many thanks.
    Raffaele

    Hi,
    Would you please elaborate your Lync environment (migration from Lync Server 2010 or a new Lync Server 2013 environment)?
    Check if there is any error message on FE Server.
    Please try to reset the assigned conference information with the help of the link below:
    http://kb.mcgill.ca/?portalid=2&articleid=5395#tab:homeTab:crumb:7:artId:5395
    If it is the migration environment, refer to the following link:
    http://weakestlync.com/2013/04/10/lync-2013-conference-error/
    Note: Microsoft is providing this information as a convenience to you. The sites are not controlled by Microsoft. Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there.
    Please make sure that you completely understand the risk before retrieving any suggestions from the above link.
    Best Regards,
    Eason Huang
    Eason Huang
    TechNet Community Support

  • 502 - Web server received an invalid response while acting as a gateway or proxy server. There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream cont

    I am getting error while accessing url of lyncweb.domain.com, dialin.domain.com and meet.domain.com pointing to RP server.
    502 - Web server received an invalid response while acting as a gateway or proxy server.
    There is a problem with the page you are looking for, and it cannot be displayed. When the Web server (while acting as a gateway or proxy) contacted the upstream content server, it received an invalid response from the content server.
    Regards, Ganesh, MCTS, MCP, ITILV2 This posting is provided with no warranties and confers no rights. Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

    When i try with https://lyncfrontend.domain.local:4443 and https://lyncfrontend.domain.com:4443 both opens but when i open the external domain name i get certificate .
    ARR version installed is 3.0
    To throw more light on the configuration:
    Lync 2013 implemented, internal domain name is : domain.local and external domain name is : domain.com
    All servers in VMs are with 4 core processor, 24gb ram, 1TB drive.
    Frontend : Windows 2012r2 with Lync 2012 Standard Edition - 1 No (192.168.10.100)
    Edge : Windows 2012 with Lync 2012 Std - 1 No 
    (192.168.11.101 DMZ) in workgroup
    ISS ARR Reverse Proxy 3.0 : Windows 2012 with ARR and IIS configured. (192.168.11.102)
    Certificate : Internal Domain root CA for internal and External (Digicert).
    Internal Network : 192.168.10.x /24
    External Network (DMZ) : 192.168.11.x /24
    Public Firewall NAT to DMZ ip for firewall and RP server. So having two public IP facing external network.
    Edge has : sip.domain.com, webconf.domain.com, av.domain.com
    IIS ARR RP server has : lyncdiscover.domain.com, lyncweb.domain.com, meet.domain.com, dialin.domain.com
    Have created SRV record in public : _sip.tls.domain.com >5061>sip.domain.com, _sipfederationtls._tcp.domain.com>5061>sip.domain.com, _xmpp-server._tcp.domain.com>5269>sip.domain.com
    Installed frontend server using MS Lync server 2013 step by step for anyone by Matt Landis, Lync MVP.
    Internal AD Integrated DNS pointing Front-end
    Type of Record FQDN
    IP Description 
    A sip.domain.com
    192.168.10.100 Address internal Front End  or Director for internal network clients 
    A admin.domain.com
    192.168.10.100 URL Administration pool
    A DialIn.domain.com
    192.168.10.100 URL Access to Dial In 
    A meet.domain.com
    192.168.10.100 URL of Web services meeting
    A lyncdiscoverinternal.domain.com
    192.168.10.100 Register for Lync AutoDiscover service to internal users
    A lyncdiscover.domain.com
    192.168.10.100 Register for Lync AutoDiscover service to external users  
    SRV Service: _sipinternaltls Protocol: _tcp Port: 5061
    sip.domain.com Record pointer services to internal customer connections using TLS 
    External DNS pointing Edge & Proxy
    Type of Record FQDN
    IP Endpoint
    A sip.domain.com
    x.x.x.100 Edge
    A webconf.domain.com
    x.x.x.100 Edge
    A av.domain.com
    x.x.x.100 Edge
    SRV _sip._tls.domain.com
    sip.domain.com: 443 Edge
    SRV _sipfederationtls._tcp.domain.com
    sip.domain.com:5061 Edge
    A Meet.domain.com
    x.x.x.110 Reverse Proxy
    A Dialin.domain.com
    x.x.x.110 Reverse Proxy
    A lyncdiscover.domain.com
    x.x.x.110 Reverse Proxy
    A lyncweb.domain.com
    x.x.x.110 Reverse Proxy
    In IIS ARR proxy server following server farms are added and configured as per link ttp://y0av.me/2013/07/22/lync2013_iisarr/
    In proxy server had setup only following server farm : While running remote connectivity web service test : meet, dialin, lyncdiscover and lyncweb.
    The client inside works fine internally and through vpn. Login with external client also working fine. But we are getting error in MRCA as follows.
    a) While testing remote connectivity for lync getting error : The certificate couldn't be validated because SSL negotiation wasn't successful. This could have occurred as a result of a network error or because of a problem with the certificate installation.
    Certificate was installed properly.
    b) For remote web test under Lync throws error : A Web exception occurred because an HTTP 502 - BadGateway response was received from IIS7.
    HTTP Response Headers:
    Content-Length: 1477
    Content-Type: text/html
    Date: Wed, 14 May 2014 10:03:40 GMT
    Server: Microsoft-IIS/8.0
    Elapsed Time: 1300 ms.
    Regards, Ganesh, MCTS, MCP, ITILV2 This posting is provided with no warranties and confers no rights. Please remember to click Mark as Answer and Vote as Helpful on posts that help you. This can be beneficial to other community members reading the thread.

  • Problem downloading the Corporate Adressbook from internal Lync Website

    Hello everybody,
    i hope you could assist me to find a solution for my big Problem in my Environment.
    The Problem :
    When my Lync 2013 Clients (with latest Updates) try to connect to our Lync 2013 Standard Frontend Server (latest CU5) + kbs installed - i can see in the IIS Logfile Problems connecting to the internal published Website:
    2014-08-18 18:11:52 W3SVC34577 FRONTENDSERVER1 172.16.169.160 GET /abs/handler/C-1358-136a.lsabs - 443 - 172.16.176.111 HTTP/1.1 OC/15.0.4641.1000+(Microsoft+Lync) - FRONTENDSERVER1.fullqualified.loc 401 0 0 5
    2014-08-19 08:23:54 W3SVC34577 frontendserver1 172.16.169.160 POST /groupexpansion/service.svc/WebTicket_Bearer - 443 - 172.16.173.65 HTTP/1.1 OC/15.0.4623.1000+(Microsoft+Lync) - frontendserver11.fullqualified.loc 500 0 0 1186
    In my Application Event Log of the Front End Server i can see :
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 19.08.2014 09:56:55
    Event time (UTC): 19.08.2014 07:56:55
    Event ID: 4744e217cc984c63af16a87fcf366c8f
    Event sequence: 7
    Event occurrence: 1
    Event detail code: 0
    Application information:
        Application domain: /LM/W3SVC/34578/ROOT/dialin-6-130529086088190776
        Trust level: Full
        Application Virtual Path: /dialin
        Application Path: E:\Program Files\Microsoft Lync Server 2013\Web Components\Dialin Page\Ext\
        Machine name: KPZLYC01
    Process information:
        Process ID: 1744
        Process name: w3wp.exe
        Account name: NT AUTHORITY\NETWORK SERVICE
    Exception information:
        Exception type: MissingMethodException
        Exception message: Method not found: 'System.Uri Microsoft.Rtc.Management.ServiceConsumer.SimpleUrlReader.GetBaseURLToSimpleDomainMappingForDialin(Microsoft.Rtc.Management.Deploy.Internal.ServiceRoles.WebService, System.Guid)'.
       at Microsoft.Rtc.Internal.Dialin.WebPages.Conference_aspx.IsValidFramingDomain(String baseURL)
       at Microsoft.Rtc.Internal.Dialin.WebPages.Conference_aspx.AddXFrameOptionHeader()
       at Microsoft.Rtc.Internal.Dialin.WebPages.Conference_aspx.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    Request information:
        Request URL: https://lnc.mefro-wheels.com:4443/Dialin/Conference.aspx
        Request path: /Dialin/Conference.aspx
        User host address: 172.16.69.63
        User: 
        Is authenticated: False
        Authentication Type: 
        Thread account name: NT AUTHORITY\NETWORK SERVICE
    Thread information:
        Thread ID: 58
        Thread account name: NT AUTHORITY\NETWORK SERVICE
        Is impersonating: False
        Stack trace:    at Microsoft.Rtc.Internal.Dialin.WebPages.Conference_aspx.IsValidFramingDomain(String baseURL)
       at Microsoft.Rtc.Internal.Dialin.WebPages.Conference_aspx.AddXFrameOptionHeader()
       at Microsoft.Rtc.Internal.Dialin.WebPages.Conference_aspx.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
    Deinstallation, reboot and reinstallation of the Web Component did not do the trick and did not help.
    Thanks for your Help!
    R. Wilke MCP / MCSA / MCSE / CCNA

    Hi Rene,
    How long have you have this problem?
    Did that work before?
    The error you provided is more related with the external dialin page.
    I would like to suggest you run the command Test-CsAddressBookService to test the ability of a user to access the server that hosts the Address Book Download Web service.
    Please check if you can search Lync contact by SIP address.
    If you can, then you can access the address book service. It take some time to download the address book file.
    Best Regards,
    Lisa Zheng
    Lisa Zheng
    TechNet Community Support

  • Cisco 871 PPPoE problem

    I have a cisco 871 router and I am not able to make a pppoe connection with ISP.
    Config:
    Building configuration...
    Current configuration : 2043 bytes
    version 12.4
    no service pad
    service timestamps debug datetime msec
    service timestamps log datetime msec
    no service password-encryption
    hostname home_gateway
    boot-start-marker
    boot-end-marker
    enable secret 5 $1$G3f1$Le8WUWVfpRAUnS0wfIJDA0
    no aaa new-model
    ip cef
    no ip dhcp use vrf connected
    ip dhcp excluded-address 10.0.0.1
    ip dhcp pool AP
       network 10.0.0.0 255.255.255.0
       default-router 10.0.0.1 
    no ip domain lookup
    ip domain name limelite
    multilink bundle-name authenticated
    username admin password 0 cisco
    archive
     log config
      hidekeys
    interface FastEthernet0
     switchport access vlan 100
    interface FastEthernet1
     switchport access vlan 100
    interface FastEthernet2
     switchport access vlan 100
    interface FastEthernet3
     switchport access vlan 200
    interface FastEthernet4
     description Link to WAN
     no ip address
     ip nat outside
     ip virtual-reassembly
     ip route-cache flow
     duplex auto
     speed auto
     pppoe enable
     pppoe-client dial-pool-number 1
    interface Vlan1
     no ip address
    interface Vlan100
     ip address 192.168.2.1 255.255.255.0
     ip nat inside
     ip virtual-reassembly
    interface Vlan200
     ip address 10.0.0.1 255.255.255.0
     ip nat inside
     ip virtual-reassembly
    interface Dialer1
     description ISP DialIn
     ip address negotiated
     ip mtu 1492
     ip nat outside
     ip virtual-reassembly
     encapsulation ppp
     ip tcp adjust-mss 1452
     dialer pool 1
     dialer-group 1
     no cdp enable
     ppp authentication pap chap callin
     ppp chap hostname xxx
     ppp chap password 0 xxx
     ppp pap sent-username xxx password 0 xxx
    ip route 0.0.0.0 0.0.0.0 Dialer1
    no ip http server
    no ip http secure-server
    ip nat inside source list 1 interface Dialer1 overload
    access-list 1 permit 192.168.2.0 0.0.0.255
    access-list 1 permit 10.0.0.0 0.0.0.255
    dialer-list 1 protocol ip permit
    control-plane
    line con 0
     logging synchronous
     login local
     no modem enable
    line aux 0
    line vty 0 4
     login local
     transport input telnet ssh
    scheduler max-task-time 5000
    webvpn cef
    end
    home_gateway#sh ip int brief
    Interface                  IP-Address      OK? Method Status                Protocol
    FastEthernet0              unassigned      YES unset  up                    up      
    FastEthernet1              unassigned      YES unset  up                    down    
    FastEthernet2              unassigned      YES unset  up                    down    
    FastEthernet3              unassigned      YES unset  up                    down    
    FastEthernet4              unassigned      YES manual up                    up      
    Vlan1                      unassigned      YES NVRAM  up                    down    
    NVI0                       unassigned      NO  unset  up                    up      
    Vlan100                    192.168.2.1     YES NVRAM  up                    up      
    Vlan200                    10.0.0.1        YES NVRAM  up                    down    
    Dialer1                    188.25.128.187  YES IPCP   up                    up      
    Virtual-Access1            unassigned      YES unset  up                    up 
    I am able to get an ip address. But cannot ping into internet.
    home_gateway#ping 8.8.8.8 source vlan 100
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
    Packet sent with a source address of 192.168.2.1 
    Success rate is 0 percent (0/5)
    home_gateway#traceroute 8.8.8.8 source vlan 100
    Type escape sequence to abort.
    Tracing the route to 8.8.8.8
      1  *  *  * 
      2  *  * 
    Nat translations are making.
    home_gateway#sh ip nat tra
    Pro Inside global         Inside local          Outside local         Outside global
    icmp 188.25.128.187:3     192.168.2.1:3         8.8.8.8:3             8.8.8.8:3
    udp 188.25.128.187:49166  192.168.2.1:49166     8.8.8.8:33434         8.8.8.8:33434
    udp 188.25.128.187:49167  192.168.2.1:49167     8.8.8.8:33435         8.8.8.8:33435
    udp 188.25.128.187:49168  192.168.2.1:49168     8.8.8.8:33436         8.8.8.8:33436
    udp 188.25.128.187:49169  192.168.2.1:49169     8.8.8.8:33437         8.8.8.8:33437
    tcp 188.25.128.187:54211  192.168.2.10:54211    81.161.59.31:80       81.161.59.31:80
    tcp 188.25.128.187:54212  192.168.2.10:54212    54.208.162.210:80     54.208.162.210:80
    tcp 188.25.128.187:54221  192.168.2.10:54221    81.161.59.31:80       81.161.59.31:80
    tcp 188.25.128.187:54222  192.168.2.10:54222    54.236.215.239:80     54.236.215.239:80
    udp 188.25.128.187:56128  192.168.2.10:56128    5.14.64.48:40572      5.14.64.48:40572
    udp 188.25.128.187:56128  192.168.2.10:56128    79.117.219.236:24111  79.117.219.236:24111
    udp 188.25.128.187:56128  192.168.2.10:56128    86.125.250.226:60404  86.125.250.226:60404
    udp 188.25.128.187:56128  192.168.2.10:56128    188.24.8.159:17835    188.24.8.159:17835
    home_gateway#
    home_gateway#sh ip ro
    Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area 
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2
           i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
           ia - IS-IS inter area, * - candidate default, U - per-user static route
           o - ODR, P - periodic downloaded static route
    Gateway of last resort is 0.0.0.0 to network 0.0.0.0
    C    192.168.2.0/24 is directly connected, Vlan100
    S*   0.0.0.0/0 is directly connected, Dialer1
    Any suggestions for what can be the problem?

    hello,
    Still is not working. Ip routing is activated by default and ip classless too in 12.4 ios version.
    I have deleted the dialer interface and reconfig it. Then tried first with the ppp ipcp route default, but still not receiving the default route. 
    I have been putting back the static route with dialer 1 exit interface.
    interface Dialer1
     mtu 1492
     ip address negotiated
     ip nat outside
     ip virtual-reassembly
     encapsulation ppp
     ip tcp adjust-mss 1452
     dialer pool 1
     dialer-group 1
     ppp pap sent-username bb1011991 password 7 005D45505D03535659761C
     ppp ipcp dns request
     ppp ipcp route default
    interface FastEthernet4
     no ip address
     duplex auto
     speed auto
     pppoe enable group global
     pppoe-client dial-pool-number 1
    All the same, I recieve Ip address.
    gateway#sh ip int brief
    Interface                  IP-Address      OK? Method Status                Protocol
    FastEthernet0              unassigned      YES unset  up                    up      
    FastEthernet1              unassigned      YES unset  up                    down    
    FastEthernet2              unassigned      YES unset  up                    down    
    FastEthernet3              unassigned      YES unset  up                    down    
    FastEthernet4              unassigned      YES manual up                    up      
    Vlan1                      unassigned      YES NVRAM  administratively down down    
    NVI0                       unassigned      NO  unset  up                    up      
    Vlan100                    192.168.2.1     YES NVRAM  up                    up      
    Vlan200                    10.0.0.1        YES NVRAM  up                    down    
    Dialer1                    188.27.188.38   YES IPCP   up                    up      
    Virtual-Access1            unassigned      YES unset  up                    up      
    I have debuged ip routing and ppp packet, this is what I got.
    Ppp packet
    gateway#ping 8.8.8.8 source vlan 100
    Type escape sequence to abort.
    Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
    Packet sent with a source address of 192.168.2.1 
    *Mar 15 19:31:37.634: Vi1 LCP: O ECHOREQ [Open] id 11 len 12 magic 0x1F9E0BC9
    *Mar 15 19:31:37.634: Vi1 LCP-FS: I ECHOREP [Open] id 11 len 12 magic 0xE49B3E1C
    *Mar 15 19:31:37.634: Vi1 LCP-FS: Received id 11, sent id 11, line up
    *Mar 15 19:31:38.558: Vi1 PPP: O pkt type 0x0021, datagramsize 102.
    *Mar 15 19:31:40.558: Vi1 PPP: O pkt type 0x0021, datagramsize 102.
    *Mar 15 19:31:42.558: Vi1 PPP: O pkt type 0x0021, datagramsize 102.
    *Mar 15 19:31:44.558: Vi1 PPP: O pkt type 0x0021, datagramsize 102.
    *Mar 15 19:31:46.558: Vi1 PPP: O pkt type 0x0021, datagramsize 102.
    Success rate is 0 percent (0/5)
    Ip routing
    *Mar 15 19:32:08.114: IP-Static:  0.0.0.0 0.0.0.0 Dialer1 Path = 1, route table no change, recursive flag clear
    *Mar 15 19:33:06.961: IP: s=192.168.2.1 (local), d=8.8.8.8 (Dialer1), len 100, sending.
    *Mar 15 19:33:08.113: RT: NET-RED 0.0.0.0/0

  • Assigned by AAA client pool problem

    folks
    i think i'm getting closer to resolving my problem with acs and dhcp
    i have an acs se (4.1) authenticating dialin users on a management network
    i'm getting duplicate ip addresses being issued by the acs so i want to use a router to allocate dhcp addresses to upto 8 scopes - one per user on the acs
    i've added the router as a aaa client on the acs with cisco ios radius and in the user settings i selected Assigned by AAA client pool and selected the pool name used on the router
    once the user tries they get authenticated but i don't see any dhcp requests to the router
    the acs se has 4 other aaa clients
    has anyone had an issue or successfully configured this before?
    thanks to anyone taking the time to read this or to post a reply
    greatly appreciated

    With ACS v4 you could do this....
    Define your pools and add your devices to their own NDGs. Then define a NAP which is triggered off each NDG. Each NAP can use its own group mapping scheme which each target group using a different IP pool.
    Probably only works when users are external as you need group mapping to make it work.
    A bit cludgy.. but should work.

  • A problem with threads

    I am trying to implement some kind of a server listening for requests. The listener part of the app, is a daemon thread that listens for connections and instantiates a handling daemon thread once it gets some. However, my problem is that i must be able to kill the listening thread at the user's will (say via a sto button). I have done this via the Sun's proposed way, by testing a boolean flag in the loop, which is set to false when i wish to kill the thread. The problem with this thing is the following...
    Once the thread starts excecuting, it will test the flag, find it true and enter the loop. At some point it will LOCK on the server socket waiting for connection. Unless some client actually connects, it will keep on listening indefinatelly whithought ever bothering to check for the flag again (no matter how many times you set the damn thing to false).
    My question is this: Is there any real, non-theoretical, applied way to stop thread in java safely?
    Thank you in advance,
    Lefty

    This was one solution from the socket programming forum, have you tried this??
    public Thread MyThread extends Thread{
         boolean active = true;          
         public void run(){
              ss.setSoTimeout(90);               
              while (active){                   
                   try{                       
                        serverSocket = ss.accept();
                   catch (SocketTimeoutException ste){
                   // do nothing                   
         // interrupt thread           
         public void deactivate(){               
              active = false;
              // you gotta sleep for a time longer than the               
              // accept() timeout to make sure that timeout is finished.               
              try{
                   sleep(91);               
              }catch (InterruptedException ie){            
              interrupt();
    }

  • A problem with Threads and MMapi

    I am tring to execute a class based on Game canvas.
    The problem begin when I try to Play both a MIDI tone and to run an infinit Thread loop.
    The MIDI tone "Stammers".
    How to over come the problem?
    Thanks in advance
    Kobi
    See Code example below:
    import java.io.IOException;
    import java.io.InputStream;
    import javax.microedition.lcdui.Graphics;
    import javax.microedition.lcdui.Image;
    import javax.microedition.lcdui.game.GameCanvas;
    import javax.microedition.media.Manager;
    import javax.microedition.media.MediaException;
    import javax.microedition.media.Player;
    public class MainScreenCanvas extends GameCanvas implements Runnable {
         private MainMIDlet parent;
         private boolean mTrucking = false;
         Image imgBackgound = null;
         int imgBackgoundX = 0, imgBackgoundY = 0;
         Player player;
         public MainScreenCanvas(MainMIDlet parent)
              super(true);
              this.parent = parent;
              try
                   imgBackgound = Image.createImage("/images/area03_bkg0.png");
                   imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
                   imgBackgoundY = this.getHeight() - imgBackgound.getHeight();
              catch(Exception e)
                   System.out.println(e.getMessage());
          * starts thread
         public void start()
              mTrucking = true;
              Thread t = new Thread(this);
              t.start();
          * stops thread
         public void stop()
              mTrucking = false;
         public void play()
              try
                   InputStream is = getClass().getResourceAsStream("/sounds/scale.mid");
                   player = Manager.createPlayer(is, "audio/midi");
                   player.setLoopCount(-1);
                   player.prefetch();
                   player.start();
              catch(Exception e)
                   System.out.println(e.getMessage());
         public void run()
              Graphics g = getGraphics();
              play();
              while (true)
                   tick();
                   input();
                   render(g);
          * responsible for object movements
         private void tick()
          * response to key input
         private void input()
              int keyStates = getKeyStates();
              if ((keyStates & LEFT_PRESSED) != 0)
                   imgBackgoundX++;
                   if (imgBackgoundX > 0)
                        imgBackgoundX = 0;
              if ((keyStates & RIGHT_PRESSED) != 0)
                   imgBackgoundX--;
                   if (imgBackgoundX < this.getWidth() - imgBackgound.getWidth())
                        imgBackgoundX = this.getWidth() - imgBackgound.getWidth();
          * Responsible for the drawing
          * @param g
         private void render(Graphics g)
              g.drawImage(imgBackgound, imgBackgoundX, imgBackgoundY, Graphics.TOP | Graphics.LEFT);
              this.flushGraphics();
    }

    You can also try to provide a greater Priority to your player thread so that it gains the CPU time when ever it needs it and don't harm the playback.
    However a loop in a Thread and that to an infinite loop is one kind of very bad programming, 'cuz the loop eats up most of your CPU time which in turn adds up more delays of the execution of other tasks (just as in your case it is the playback). By witting codes bit efficiently and planning out the architectural execution flow of the app before start writing the code helps solve these kind of issues.
    You can go through [this simple tutorial|http://oreilly.com/catalog/expjava/excerpt/index.html] about Basics of Java and Threads to know more about threads.
    Regds,
    SD
    N.B. And yes there are more articles and tutorials available but much of them targets the Java SE / EE, but if you want to read them here is [another great one straight from SUN|http://java.sun.com/docs/books/tutorial/essential/concurrency/index.html] .
    Edited by: find_suvro@SDN on 7 Nov, 2008 12:00 PM

  • J2ME problem with threads

    Hi all,
    I would like to ask you for a help. I need to write a small program at my university. I started to write a midlet which function would be to countdown time for sports activities. I woul like to start a new thread - the one that counts down - and at the same time make the main thread sleep. After the "countdown" thread finishes, the main thread wakes up and waits for user input. The problem is that when the "countdown" thread finishes his work, I've got Uncaught exception java/lang/NullPointerException. error and the midlet halts.
    Below you can find the code
    import java.lang.*;
    import java.util.*;
    import javax.microedition.lcdui.*;
    import javax.microedition.midlet.*;
    public class intervals extends MIDlet implements CommandListener
    public Display ekran;
    private SweepCanvas sweeper;
    private Form rundy;
    private TextField round0, round1, round2, round3, round4, round5, round6, round7, round8;
    private long czas,x;
    private Command exitCommand;
    private Command addRound;
    private Command delRound;
    private Command start;
    private TextField repeat;
    private Form odliczanie;
    private Alert ostrz;
    Licznik thread;
    String test;
    StringItem test1;
    int parz,i,j,k;
    static int l;
    int ilrund;
    int ilpowt;
    Item sec;
    long sec1;
    public intervals()
        rundy = new Form("Interwa&#322;y sportowe");
        exitCommand = new Command("Wyj&#347;cie", Command.EXIT, 2);
        addRound = new Command("Dodaj","Dodaj rund&#281;", Command.ITEM,1);
        delRound = new Command("Usu&#324;","Usu&#324; ostatni&#261; rund&#281;", Command.ITEM,1);
        start = new Command("Start", Command.ITEM,1);
        odliczanie = new Form("Odliczanie");
        TextField dodaj(TextField kolej)
            kolej=new TextField("Podaj czas (s) rundy "+parz,null, 4, TextField.NUMERIC);//stworzenie nowej instancji do wybierania czasu trwania rundy
            if(rundy.size()==0)
                rundy.insert(rundy.size(),kolej);
                else
                    rundy.insert(rundy.size()-1, kolej);
            return kolej;
        void odliczanie(TextField round)
            monitor m=new monitor();
            k=Integer.parseInt(round.getString());
            ekran.setCurrent(odliczanie);
            thread=new Licznik(k,odliczanie);
            thread.start();
            ekran.setCurrent(rundy);
    public void startApp()// throws MIDletStateChangeException
        rundy.deleteAll();
        repeat = new TextField("Podaj ilo&#347;&#263; powtórze&#324;",null,1,TextField.NUMERIC);
        rundy.addCommand(addRound);
        rundy.addCommand(exitCommand);
        rundy.setCommandListener(this);
        Canvas obrazek = new MyCanvas();
        ekran = Display.getDisplay(this);
        ekran.setCurrent(obrazek);
        czas=System.currentTimeMillis();
        while (System.currentTimeMillis()<czas+1000)
            continue;
        ekran.setCurrent(rundy);
    public void pauseApp()
    public void destroyApp(boolean unconditional)
        notifyDestroyed();
    public void commandAction(Command c, Displayable s)
        if (c == exitCommand)
            destroyApp(false);
            notifyDestroyed();
        else if(c==addRound)
            if(rundy.size()==0)//Sprawdzenie ilo&#347;ci elementów w celu poprawnego wy&#347;wietlania liczby rund w formie
                parz=1;
                else
                parz=rundy.size();
            switch(parz)
                case 1:
                    round0=dodaj(round0);break;
                case 2:
                    round1=dodaj(round1);break;
                case 3:
                   round2= dodaj(round2);break;
                case 4:
                    round3=dodaj(round3);break;
                case 5:
                    round4=dodaj(round4);break;
                default:
                    ostrz=new Alert("Uwaga","Maksymalna liczba rund wynosi 9", null, AlertType.INFO);
                    ostrz.setTimeout(3000);
                    ekran.setCurrent(ostrz);
            if(rundy.size()==1)
                rundy.append(repeat);
                rundy.addCommand(start);
            rundy.addCommand(delRound);
        else if(c==delRound)
            if(rundy.size()!=0)
                rundy.delete(rundy.size()-2);
                if (rundy.size()==1)
                    rundy.deleteAll();
                if(rundy.size()==0)
                    rundy.removeCommand(delRound);
                    rundy.removeCommand(start);
        else if(c==start)
            ilrund=rundy.size()-1;
            if(this.repeat.size()>0)
                ilpowt=Integer.parseInt(this.repeat.getString());
            ekran = Display.getDisplay(this);
            for (i=1; i<=ilpowt;i++)
                odliczanie= new Form("Odliczanie");
                 for (j=0;j<ilrund;j++)
                    switch(j)
                         case 0:
                             odliczanie(round0);
                             break;
                         case 1:
                             odliczanie(round1);
                             break;
                         case 2:
                             odliczanie(round2);
                             break;
                         case 3:
                             odliczanie(round3);
                             break;
                         case 4:
                             odliczanie(round4);
                             break;
                         case 5:
                             odliczanie(round5);
                             break;
                         case 6:
                             odliczanie(round6);
                             break;
                         case 7:
                             odliczanie(round7);
                             break;
                         case 8:
                             odliczanie(round8);
                             break;
    class Licznik extends Thread
        int czas1,k;
        Form forma;
        monitor m;
        public Licznik(int k,Form formap)
            czas1=k;
            forma=formap;
        public synchronized void run()
            while(czas1>0)
                forma.deleteAll();
                forma.append("Czas pozosta&#322;y (s): "+czas1);
                try{Thread.sleep(1000);} catch(InterruptedException e){e.printStackTrace();}
                czas1--;
            if(czas1<=0)
                m.put();
        }and monitor class
    public class monitor
    boolean busy=false;
    synchronized void get()
        if(!busy)
            try
                wait();
            }catch(InterruptedException e){e.printStackTrace();}
        notify();
    synchronized void put()
        if(busy)
            try
            wait();
            }catch(InterruptedException e){e.printStackTrace();}
        busy=true;
        notify();
    }Can anybody help me with this?

    Groovemaker,
    Your Licznik class has a member m of type monitor, which has not been instantiated (in other words is null) hence, when calling m.put() you get NullPointerException. Please also mind, that using Thread.sleep(1000) is not an accurate way of measuring time.
    If I may, please use recommended for Java class naming conventions - some of your names use lower case, while other don't which is confusing to the reader.
    Daniel

  • Problem with threads within applet

    Hello,
    I got an applet, inside this applet I have a singleton, inside this singleton I have a thread.
    this thread is running in endless loop.
    he is doing something and go to sleep on and on.
    the problem is,
    when I refresh my IE6 browser I see more than 1 thread.
    for debug matter, I did the following things:
    inside the thread, sysout every time he goes to sleep.
    sysout in the singleton constructor.
    sysout in the singleton destructor.
    the output goes like this:
    when refresh the page, the singleton constructor loading but not every refresh, sometimes I see the constructor output and sometimes I dont.
    The thread inside the singleton is giving me the same output, sometime I see more than one thread at a time and sometimes I dont.
    The destructor never works (no output there).
    I don't understand what is going on.
    someone can please shed some light?
    thanks.
    btw. I am working with JRE 1.1
    this is very old and big applet and I can't convert it to something new.

    Ooops. sorry!
    I did.
         public void start() {
         public void stop() {
         public void destroy() {
              try {
                   resetAll();
                   Configuration.closeConnection();
                   QuoteItem.closeConnection();
              } finally {
                   try {
                        super.finalize();
                   } catch (Throwable e) {
                        e.printStackTrace();
         }

  • Problem with Threads and a static variable

    I have a problem with the code below. I am yet to make sure that I understand the problem. Correct me if I am wrong please.
    Code functionality:
    A timer calls SetState every second. It sets the state and sets boolean variable "changed" to true. Then notifies a main process thread to check if the state changed to send a message.
    The problem as far I understand is:
    Assume the timer Thread calls SetState twice before the main process Thread runs. As a result, "changed" is set to true twice. However, since the main process is blocked twice during the two calls to SetState, when it runs it would have the two SetState timer threads blocked on its synchronized body. It will pass the first one, send the message and set "changed" to false since it was true. Now, it will pass the second thread, but here is the problem, "changed" is already set to false. As a result, it won't send the message even though it is supposed to.
    Would you please let me know if my understanding is correct? If so, what would you propose to resolve the problem? Should I call wait some other or should I notify in a different way?
    Thanks,
    B.D.
    Code:
    private static volatile boolean bChanged = false;
    private static Thread objMainProcess;
       protected static void Init(){
            objMainProcess = new Thread() {
                public void run() {
                    while( objMainProcess == Thread.currentThread() ) {
                       GetState();
            objMainProcess.setDaemon( true );
            objMainProcess.start();
        public static void initStatusTimer(){
            if(objTimer == null)
                 objTimer = new javax.swing.Timer( 1000, new java.awt.event.ActionListener(){
                    public void actionPerformed( java.awt.event.ActionEvent evt){
                              SetState();
        private static void SetState(){
            if( objMainProcess == null ) return;
            synchronized( objMainProcess ) {
                bChanged = true;
                try{
                    objMainProcess.notify();
                }catch( IllegalMonitorStateException e ) {}
        private static boolean GetState() {
            if( objMainProcess == null ) return false;
            synchronized( objMainProcess ) {
                if( bChanged) {
                    SendMessage();
                    bChanged = false;
                    return true;
                try {
                    objMainProcess.wait();
                }catch( InterruptedException e ) {}
                return false;
        }

    Thanks DrClap for your reply. Everything you said is right. It is not easy to make them alternate since SetState() could be called from different places where the state could be anything else but a status message. Like a GREETING message for example. It is a handshaking message but not a status message.
    Again as you said, There is a reason I can't call sendMessage() inside setState().
    The only way I was able to do it is by having a counter of the number of notifies that have been called. Every time notify() is called a counter is incremented. Now instead of just checking if "changed" flag is true, I also check if notify counter is greater than zero. If both true, I send the message. If "changed" flag is false, I check again if the notify counter is greater than zero, I send the message. This way it works, but it is kind of a patch than a good design fix. I am yet to find a good solution.
    Thanks,
    B.D.

  • Problem with threads running javaw

    Hi,
    Having a problem with multi thread programming using client server sockets. The program works find when starting the the application in a console using java muti.java , but when using javaw multi.java the program doesnt die and have to kill it in the task manager. The program doesnt display any of my gui error messages either when the server disconnect the client. all works find in a console. any advice on this as I havent been able to understand why this is happening? any comment would be appreciated.
    troy.

    troy,
    Try and post a minimum code sample of your app which
    does not work.
    When using javaw, make sure you redirect the standard
    error and standard output streams to file.
    Graeme.Hi Graeme,
    I dont understand what you mean by redirection to file? some of my code below.
    The code works fine under a console, code is supposed to exit when the client (the other server )disconnects. the problem is that but the clientworker side of the code still works. which under console it doesnt.
    public class Server{
    ServerSocket aServerSocket;
    Socket dianosticsSocket;
    Socket nPortExpress;
    ClientListener aClientListener;
    LinkedList queue = new LinkedList();
    int port = 0;
    int clientPort = 0;
    String clientName = null;
    boolean serverAlive = true;
    * Server constructor generates a server
    * Socket and then starts a client threads.
    * @param aPort      socket port of local machine.
    public Server(int aPort, String aClientName, int aClientPort){
    port = aPort;
    clientName = aClientName;
    clientPort = aClientPort;
    try{
    // create a new thread
    aServerSocket = new ServerSocket(port) ;
    // connect to the nPortExpress
    aClientListener = new ClientListener(InetAddress.getByName(clientName), clientPort, queue,this);
    // aClientListener.setDaemon(true);
    aClientListener.start();
    // start a dianostic port
    DiagnosticsServer aDiagnosticsServer = new DiagnosticsServer(port,queue,aClientListener);
    // System.out.println("Server is running on port " + port + "...");
    // System.out.println("Connect to nPort");
    catch(Exception e)
    // System.out.println("ERROR: Server port " + port + " not available");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Server port " + port + " not available", JOptionPane.ERROR_MESSAGE);
    serverAlive = false;
    System.exit(1);
    while(serverAlive&&aClientListener.hostSocket.isConnected()){
    try{
    // connect the client
    Socket aClient = aServerSocket.accept();
    //System.out.println("open client connection");
    //System.out.println("client local: "+ aClient.getLocalAddress().toString());
    // System.out.println("client localport: "+ aClient.getLocalPort());
    // System.out.println("client : "+ aClient.getInetAddress().toString());
    // System.out.println("client port: "+ aClient.getLocalPort());
    // make a new client thread
    ClientWorker clientThread = new ClientWorker(aClient, queue, aClientListener, false);
    // start thread
    clientThread.start();
    catch(Exception e)
    //System.out.println("ERROR: Client connection failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client connection failure", JOptionPane.ERROR_MESSAGE);
    }// end while
    } // end constructor Server
    void serverExit(){
         JOptionPane.showMessageDialog(null, "Server ","ERROR: nPort Failure", JOptionPane.ERROR_MESSAGE);
         System.exit(1);
    }// end class Server
    *** connect to another server
    public class ClientListener extends Thread{
    InetAddress hostName;
    int hostPort;
    Socket hostSocket;
    BufferedReader in;
    PrintWriter out;
    boolean loggedIn;
    LinkedList queue;      // reference to Server queue
    Server serverRef; // reference to main server
    * ClientListener connects to the host server.
    * @param aHostName is the name of the host eg server name or IP address.
    * @param aHostPort is a port number of the host.
    * @param aLoginName is the users login name.
    public ClientListener(InetAddress aHostName, int aHostPort,LinkedList aQueue,Server aServer)      // reference to Server queue)
    hostName = aHostName;
    hostPort = aHostPort;
    queue = aQueue;
    serverRef = aServer;      
    // connect to the server
    try{
    hostSocket = new Socket(hostName, hostPort);
    catch(IOException e){
    //System.out.println("ERROR: Connection Host Failed");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort Failed", JOptionPane.ERROR_MESSAGE);     
    System.exit(0);
    } // end constructor ClientListener
    ** multi client connection server
    ClientWorker(Socket aSocket,LinkedList aQueue, ClientListener aClientListener, boolean diagnostics){
    queue = aQueue;
    addToQueue(this);
    client = aSocket;
    clientRef = aClientListener;
    aDiagnostic = diagnostics;
    } // end constructor ClientWorker
    * run method is the main loop of the server program
    * in change of handle new client connection as well
    * as handle all messages and errors.
    public void run(){
    boolean alive = true;
    String aSubString = "";
    in = null;
    out = null;
    loginName = "";
    loggedIn = false;
    while (alive && client.isConnected()&& clientRef.hostSocket.isConnected()){
    try{
    in = new BufferedReader(new InputStreamReader(client.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(client.getOutputStream()));
    if(aDiagnostic){
    out.println("WELCOME to diagnostics");
    broadCastDia("Connect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    out.println("WELCOME to Troy's Server");
    broadCastDia("Connect : client "+client.getInetAddress().toString());
         out.flush();
    String line;
    while(((line = in.readLine())!= null)){
    StringTokenizer aStringToken = new StringTokenizer(line, " ");
    if(!aDiagnostic){
    broadCastDia(line);
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    else{
    if(line.equals("GETIPS"))
    getIPs();
    else{
    clientRef.sendMessage(line); // send mesage out to netExpress
    out.println(line);
    out.flush();
    } // end while
    catch(Exception e){
    // System.out.println("ERROR:Client Connection reset");
                             JOptionPane.showMessageDialog(null, (e.toString()),"ERROR:Client Connection reset", JOptionPane.ERROR_MESSAGE);     
    try{
    if(aDiagnostic){
    broadCastDia("Disconnect : diagnostics "+client.getInetAddress().toString());
    out.flush();
    else {       
    broadCastDia("Disconnect : client "+client.getInetAddress().toString());
         out.flush();
    // close the buffers and connection;
    in.close();
    out.close();
    client.close();
    // System.out.println("out");
    // remove from list
    removeThreadQueue(this);
    alive = false;
    catch(Exception e){
    // System.out.println("ERROR: Client Connection reset failure");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Client Connection reset failure", JOptionPane.ERROR_MESSAGE);     
    }// end while
    } // end method run
    * method run - Generates io stream for communicating with the server and
    * starts the client gui. Run also parses the input commands from the server.
    public void run(){
    boolean alive = true;
    try{
    // begin to life the gui
    // aGuiClient = new ClientGui(hostName.getHostName(), hostPort, loginName, this);
    // aGuiClient.show();
    in = new BufferedReader(new InputStreamReader(hostSocket.getInputStream()));
    out = new PrintWriter(new OutputStreamWriter(hostSocket.getOutputStream()));
    while (alive && hostSocket.isConnected()){
    String line;
    while(((line = in.readLine())!= null)){
    System.out.println(line);
    broadCast(line);
    } // end while
    } // end while
    catch(Exception e){
    //     System.out.println("ERRORa Connection to host reset");
    JOptionPane.showMessageDialog(null, (e.toString()),"ERROR: Connection to nPort reset", JOptionPane.ERROR_MESSAGE);
    try{
    hostSocket.close();
         }catch(Exception a){
         JOptionPane.showMessageDialog(null, (a.toString()),"ERROR: Exception", JOptionPane.ERROR_MESSAGE);
    alive = false;
    System.exit(1);
    } // end method run

Maybe you are looking for

  • I had a pc with itunes installed, and i recently bought a mac. is there a way to transfer music from my pc to my mac besides saving on a seperate hard drive?

    i had a dell pc and had itunes installed in my pc. i recently just bought a macbook pro. i want to know if there is a way, outside of just saving the music on a hard drive and uploading it to mac, to send it through my itunes account or something.

  • CAn't connect to Internet Through Time Capsule-Self Assigned IP Adress

    My iBook battery died. After connecting to power source, I can't connect to the internet. I get a message that the iBook is self assigning the IP address. How do I correct this? I've removed the battery & done several restarts with no success.

  • MP4/H.264 video format license for selling videos

    Hello! I have searched on the forums and I did not find anything new about this topic. I create animated films and I want to export them as .mp4 with H.264 codec. Can I use these films with commercial purpose? (I want to sell the films to companies,

  • Difficulty writing query

    how do i write query query from a table columns? For example the below query retrun the following.... Query:- select 'select ( sum ( vsize ('||column_name ||'))' from dba_tab_columns where table_name = 'SAP_LONE_TEXT'; Result: 'SELECT(SUM(VSIZE('||CO

  • ORA-02063

    Hello, I'm using OTG and I got this error when testing the code in Case 4a that comes with the product docs: The code is DECLARE EID SMALLINT; EMPLOYEE VARCHAR(10); DEPARTMENT VARCHAR(14); DN NUMBER; BEGIN EMPLOYEE := 'WARD'; DEPARTMENT := 'RESEARCH'