Oracle 9.2.0.8 client or server?

Hey guys,
I'm a little bit confused in regards to the patches for Oracle client/server. The new 9.2.0.8 patch, is this for client or server or both? Would there be any issues if the client and server are not on the same level?
For example, if I have a 9.2.06 database, can I apply 9.2.0.8 patch for my client?
Let us consider, this is for Win 32-bit O/Ss.
What would be the case for Solaris based O/Ss?
Thanks in advance

The same patch can be used to upgrade your database or to upgrade your client.
Normally its not a must to have both client & server the same version. But it is always better to have the same to eliminate any unexpected problems.
In general Oracle is always backward compatible for reasons of migrations etc.

Similar Messages

  • Oracle 8.1.7.3 client on Windows Server 2008 64bit

    Hi all!
    I'm a newbie to Oracle and this forum, so please be gentle...:)
    I'm trying to install Oracle 8.1.7.3 client on a 64bit Windows Server 2008, without success. Best result I got so far is 'installed' client and provider, but unable to run the config tools, or use the provider. I installed the same client on a 32bit version of Win Server 2008 and it worked with few minor tweaks.
    Reason I'm doing this is trying to integrate an old legacy Oracle 7 database with SQL Server 2008 using linked servers.
    Upgrading to a recent version is not an option.
    Anyone has any guidelines? please help, this is driving me nuts!
    Thanx,
    Igor

    user12219185 wrote:
    hmmm i'm trying the download on http://edelivery.oracle.com, but can't find 64bit client.. it has 64bit database version, which is 2 cds... is the client included?
    The client is included. Download it and start the installation. It should give you an option to select 'client only'.

  • Existing client (Oracle 8) fail to connect to its server after installed

    After installed Oracle 10g XE, my existing client does not work.
    I checked its tnsnames.ora, it's still there and the content didn't get changed.
    If I uninstall the 10g XE, the existing client works again.
    What should I do to avoid this?

    I have the following configuration:
    OS: Windows 2000 Professional in spanish language
    ram=512 MB
    Oracle databases: Oracle 8i 8.1.7 on HP-UX servers
    Number of databases: 2
    Number of instances: 6 (production, test and developers)
    transport: TCP
    1. Before install Oracle 10g XE:
    Oracle Developer 6.0,in C:\ORANT, in english language
    - Oracle Forms 32-bit (6.0.35.3)
    - Oracle Reports 32-bits (6.0.5.35)
    PATH=C:\C:\ORANT\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
    TNSNAMES.ORA in C:\ORANT\NET80\ADMIN points to the enterprise databases in my company
    Registry: HKLM\Software\Oracle\Oracle_home=C:\ORANT
    2. After Installed Oracle 10g XE (beta 1)
    the path now is:
    path=C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\ORANT\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
    The web interface of XE works oK
    the C:\oraclexe\app\oracle\product\10.2.0\server\BIN\sqlplus.exe can connect to Oracle 10g XE but NOT to the enterprises databases.
    but now, all tools from Oracle Developer (Forms, Reports, PLUS80W.EXE) and third party tools like SQLTools, DreamCoder) cann't connect to the enterprise databases
    neither to Oracle 10g XE.
    In the registry, the ORACLE_HOME says C:\ORANT
    Solution:
    1. Modified the path so c:\orant is before the path to XE so:
    path=C:\ORANT\bin;C:\oraclexe\app\oracle\product\10.2.0\server\bin;C:\WINNT\system32;C:\WINNT;C:\WINNT\System32\Wbem
    2. Copy from C:\oraclexe\app\oracle\product\10.2.0\server\NETWORK\ADMIN\tnsnames.ora,
    the lines:
    XE =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mycomputer.domainname.com)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    and copied into C:\ORANT\NET80\ADMIN\TNSNAMES.ORA as
    XE.world =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = mycomputer)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = XE)
    and Now:
    1.The Developer tools third party tools can connect to the enterprise databases.
    2.The develper tools and third party tools can connect to Oracle 10g XE
    3.C:\oraclexe\app\oracle\product\10.2.0\server\BIN\sqlplus.exe can connect to Oracle 10g XE
    Bye
    Alvaro Alonso_G
    OCP
    Bogota, Colombia (South America)

  • Configure client and server

    Hi ,
    Iam trying to configure client and server on OEL5.5 on vmware server i ahve 2 virtual machines which are on network i want to make one machine as server and another as client so on server machine i have a database called as SERVER and iam creating a listerner for it and my listener is created i chked my listener.ora files but on termianal when i execute
    LSNRCTL> STATUS LISTENER1
    TNS-01101: Could not find service name
    LSNRCTL>
    LSNRCTL> START LISTENER1
    Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
    TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener1.log
    Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10g.home.com)(PORT=2525)))
    TNS-12542: TNS:address already in use
    TNS-12560: TNS:protocol adapter error
    TNS-00512: Address already in use
    Linux Error: 98: Address already in use
    Listener failed to start. See the error message(s) above...
    and copying and pasting the contents of listener.ora file
    # listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    LISTENER1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle10g.home.com)(PORT = 2525))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    SID_LIST_LISTENER1 =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = server)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (SID_NAME = server)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle10g.home.com)(PORT = 1521))
    so as there is only 2 listeners on my machine named as listener which listens at 1521(default) and another which i created listener2 listens as 2525
    so please help me and let me know where iam going wrong
    Thanks in advance ....
    with Regards
    Kavita

    user12665759 wrote:
    Hi ,
    Iam trying to configure client and server on OEL5.5 on vmware server i ahve 2 virtual machines which are on network i want to make one machine as server and another as client so on server machine i have a database called as SERVER and iam creating a listerner for it and my listener is created i chked my listener.ora files but on termianal when i execute
    LSNRCTL> STATUS LISTENER1
    TNS-01101: Could not find service name
    LSNRCTL>
    LSNRCTL> START LISTENER1
    Starting /u01/app/oracle/product/10.2.0/db_1/bin/tnslsnr: please wait...
    TNSLSNR for Linux: Version 10.2.0.1.0 - Production
    System parameter file is /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    Log messages written to /u01/app/oracle/product/10.2.0/db_1/network/log/listener1.log
    Error listening on: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=oracle10g.home.com)(PORT=2525)))
    TNS-12542: TNS:address already in useThose last two lines tell the tale. Something else is running on port 2525. Why are you trying to use that port for your listener?
    Use netstat to find out what process is using the port.
    And as a follow-up, why configure two listeners?
    TNS-12560: TNS:protocol adapter error
    TNS-00512: Address already in use
    Linux Error: 98: Address already in use
    Listener failed to start. See the error message(s) above...
    and copying and pasting the contents of listener.ora file
    # listener.ora Network Configuration File: /u01/app/oracle/product/10.2.0/db_1/network/admin/listener.ora
    # Generated by Oracle configuration tools.
    LISTENER1 =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle10g.home.com)(PORT = 2525))
    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (PROGRAM = extproc)
    SID_LIST_LISTENER1 =
    (SID_LIST =
    (SID_DESC =
    (GLOBAL_DBNAME = server)
    (ORACLE_HOME = /u01/app/oracle/product/10.2.0/db_1)
    (SID_NAME = server)
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC1))
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oracle10g.home.com)(PORT = 1521))
    so as there is only 2 listeners on my machine named as listener which listens at 1521(default) and another which i created listener2 listens as 2525
    so please help me and let me know where iam going wrong
    Thanks in advance ....
    with Regards
    Kavita

  • Can i install 10.2.0.4 patch set 14 on my client when SERVER is at 10.2.0.4

    ======================================================
    Can i install 10.2.0.4 patch set 14 on my client when SERVER is at 10.2.0.4 patchset 5?
    ======================================================
    We have a customer with DB on windows-2003 64 bit with following homes.
    At Server version:-
    DB version is 10.2.0.4 patchset 5,
    client1 is at 10.2.0.1.(patchset i am not sure)
    Client2 is at 10.2.0.4 patchset 5.
    Customer running some sqls which are taking more time from CLIENT2(10.2.0.4 patchset5) than CLIENT1(10.2.0.1). offcourse both CLIENTS connecting
    same DB. we identified a bug(6350579). This bug was resolved in 10.2.0.4 patch 14(7677781).
    Now my question is Can i apply this patch only at client side with out applying at DB level?
    I mean i will create one more new client called CLINET3 (with 10.2.0.4 and i will install 10.2.0.4 patchset14) and then run the SQLs from new client CLIENT3. is this supported method or not?
    Reason being customer does not want to install 10.2.0.4 patchset14 at DB since Customer is happy with DB performance.
    We are getting problem only when we connect to DB from cleint 10.2.0.4 patchset5. if we connect to DB from Client 10.2.0.1, SQL performance is very good.
    Please advise me on this.
    Regards
    Nagendra.

    You can upgrade your client with the latest patchset/bug fix (if you have tested it on some other machine and found that your issue has been resolved) but be prepared to handle any unusual errors that might arise due to this combination.
    Personally, I never prefer having a client running at a higher version than the server but there are some situations where we need to and we need to make sure that, even though Oracle must have tested certain scenarios, we do not run into errors. So test, test and test before changing anything in production.
    Edited by: Satish Kandi on Feb 9, 2009 6:26 PM
    Revised a bit.

  • To_char displays different results on sql client and server

    Hi,
    I am executing the below query on my database with 8.1.7.4 version:
    SQL> select to_char(to_date('20-OCT-07'),'D') from dual;
    The following result is displayed:
    T
    7
    When the same query is being run through sqlplus client(9.2.0.3) connecting to the same database, following result is being displayed:
    SQL> select to_char(to_date('20-OCT-07'),'D') from dual;
    T
    6
    Could anyone please explain me why is this difference and what parameter setting needs to be made to get the same result.
    Thanks in advance,
    Vishwanath

    Or from the territory part of NLS_LANG OS variable :
    oracle@xxx:/home/oracle# echo $NLS_LANG
    AMERICAN_AMERICA.UTF8
    oracle@xxx:/home/oracle# sqlplus '/ as sysdba'
    SQL*Plus: Release 9.2.0.8.0 - Production on Mon Oct 22 10:44:59 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    SQL> select to_char(to_date('20-OCT-07'),'D') from dual;
    T
    7
    SQL> quit
    Disconnected from Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    oracle@xxx:/home/oracle# export NLS_LANG=AMERICAN_FRANCE.UTF8
    oracle@xxx:/home/oracle# sqlplus '/ as sysdba'
    SQL*Plus: Release 9.2.0.8.0 - Production on Mon Oct 22 10:45:38 2007
    Copyright (c) 1982, 2002, Oracle Corporation.  All rights reserved.
    Connected to:
    Oracle9i Enterprise Edition Release 9.2.0.8.0 - 64bit Production
    With the Partitioning, OLAP and Oracle Data Mining options
    JServer Release 9.2.0.8.0 - Production
    SQL> select to_char(to_date('20-OCT-07'),'D') from dual;
    T
    6
    SQL>Check it on both sites (client and server).
    Nicolas.

  • Need to test db connectivity from Oracle 8.1.6 NT client

    Our applications run on Windows NT servers and connect to the Oracle db server through an Oracle 8.1.6 NT Client. The Oracle db server is running Oracle 8.1.6.2 on HPUX 11.0. I am using commands in a batch file to restart the application services on the NT server when the database is brought down. Before starting the services back up I need to be able to make sure that the database is up. I was using the tnsping command to do this, but I found out that tnsping gives an 'OK' response when the listener is running and the database is down. I need something that works like tnsping, but tests for connectivity to the database, not just the listener.
    I appreciate any help anyone can give me.
    The following is the code from the batch file:
    REM ******************************************************
    REM Stop the TM Proc Mon Service
    net stop TMProcMonSrvc
    REM ******************************************************
    :CHECKDB
    REM Check the connectivity to the database
    tnsping tm52ut
    REM Check to see if the tnsping was successful (=0)
    IF %ERRORLEVEL%==0 GOTO STARTTM
    GOTO CHECKDB
    REM ******************************************************
    :STARTTM
    REM Start the TM Proc Mon Service
    net start TMProcMonSrvc
    REM ******************************************************
    :EXIT
    exit

    Use sqlplus. Use a bogus username/password (if and watch out for the Invalid username error. If you get an invalid username/password error then the db is up else it is down. Suggestion: It would be much easier to write a wsh script that uses ADO to connect to the db. Batch files do not give you much control over the shell.

  • Incorrect download file for Oracle 9.2.0.1 for Windows server 2003

    Hi,
    I am trying to get hold of the Oracle 9.2.0.1 client software for Windows server 2003 from <http://www.oracle.com/technology/software/products/oracle9i/index.html> the link is in the section "Oracle9i Release 2 (9.2.0.1)", titled "Oracle9i Database Release 2 Enterprise/Standard/Personal/Client Edition for Windows Server 2003 (32-bit)"
    I follow the links through and download the OUI and "9.2.0.1" software, however after downloading and unzipping the package it seems that the download was actually the 9.2.0.3 patch that cannot be installed without 9.2.0.1 installed first. I tried this on Friday and today with the same results.
    Could you tell me how I get hold of the 9.2.0.1 client software for Windows Server 2003 please?
    Thanks,
    Mark Williams

    As Windows 2003 is officially released this week, I believe Oracle will shortly announce which versions of the database will be supported on Windows 2003. Stay tuned.
    Alison

  • Strange problem with SQLPLUS when client and server on the same box

    Hi,
    I have the problem with SQLPLUS when clinet and server on the same machine.
    With client and server on the same machine i am running the command
    sqlplus -l username/password@connect_identifier as SYSDBA.
    With this command, even if you pass in wrong username or wrong password or both as wrong you can able to connect to database and execute queries.
    Once Connect_identifier is correct and trying to log in as SYSDBA ,sqlplus will log in to DB with any username and password.
    How to get rid of this behaviour. Is there any way to do this.
    I am running this command by creating a process in C#
    Edited by: user11000236 on Jun 16, 2009 10:31 AM

    user11000236 wrote:
    Thanks for the info.
    How does Oracle/SQLPLUS allows any username or password to log in to DB with SYSDBA Privillages? What is the concept behind this.?
    This is explainted in the above mentioned link:
    Operating system authentication takes precedence over password file authentication. If you meet the requirements for operating system authentication, then even if you use a password file, you will be authenticated by operating system authentication.

  • 9i client + 11g server connection

    Hi
    Is it possible to connect to Oracle 11g server from a computer where Oracle 9i client and server are installed locally?
    Thanx

    Check metalink note 207303.1
    If client is 9.2 then You can connect to 11g database if lower, it's not supported.

  • Oracle 11g Database 64-bit, Client 32-bit

    Hi,
    I have a problem,
    I have an IBM Sever with 64-bit processors.
    On it there is a Windows Server 2008 also 64-bit. I've installed Oracle Client 11g 64-bit. And there is my problem.
    I can't connect to this database using tools like SQLTools or BDE Administrator. I can only connect via SQL PLUS (which is installed with Oracle). Also with installed Client 11g 32-bit on Windows XP 32-bit(connected via LAN) I can't connect.
    While trying to open SQLTools there is a problem with some .dll (I can't remember now what's this .dll, definitely not OCI.dll).
    Reinstalling programs doesn't help.
    Another problem I have is with HP ProLiant Server. It's also 64-bit installation.
    Also Win Server 2008 and Oracle 11g 64-bit. On it is the same problem, but the information while starting SQLTools is a problem with OCI.dll . Also reinstalling is not helping.
    Do you guys have any idea, what's wrong??
    Cheers...

    Just to try to determine if it is a bit-level issue (which it shouldn't be--this has never been a problem for me in the past), try installing 32-bit Oracle client on a workstation and seeing if you can connect.
    I agree with the above poster, who said these tools might not be compatible with Oracle 11--they might be looking at different data dictionary views or something similar.

  • Diff betn client installation & server Installation

    can anybody pls tell me the difference between client installation & server installation of oracle 9i

    The Client
    The client is the front-end database application, accessed by a user through the keyboard, display, and pointing device, such as a mouse. The client has no data access responsibilities. It requests, processes, and presents data managed by the server. The client workstation can be optimized for its job. For example, it might not need large disk capacity, or it might benefit from graphic capabilities.
    Often, the client runs on a different computer than the database server, generally on a PC. Many clients can simultaneously run against one server.
    The Server
    The server runs Oracle software and handles the functions required for concurrent, shared data access. The server receives and processes the SQL and PL/SQL statements that originate from client applications. The computer that manages the server can be optimized for its duties. For example, it can have large disk capacity and fast processors.
    More at (Oracle Database Concepts guide) http://download.oracle.com/docs/cd/B10501_01/server.920/a96524/c01_02intro.htm#43056
    So basicaly if you will install client then you will install binaries and libraries for connecting and using to database server.

  • Migration from Oracle 9i 32 bit to Oracle 10G 64 bit on Windows 2003 Server

    I am working on migrating Oracle 9i 32 bit to Oracle 10G 64 bit on Windows 2003 from Old server to new server. We have db around 500 GB and 3 schemas. I installed Oracle 10G on new server, created tablespaces, schema's blah blah and now doing export and import at schema level from old server to new server.
    Import is taking more than 4 to 5 hours on new server. My manager is saying, window time is bit longer and he wants me to try possiblities to make this process faster. Can some one help me on this, to use the best possible method to complete this process faster?
    Will below step work, if I try?
    If I install, oracle 9i and 10g both on new server in different home directories and take the hot backup from old machine and restore on new machine in 9i home directory and use the upgrade configuration assistant from 10g and do the upgrade? Pls advice.
    Thanks in advance,
    Hari babu
    Edited by: user6367891 on Mar 2, 2010 5:28 AM

    It looks good.
    I have one question in below steps:
    To migrate an Oracle9i or older database to an Oracle Database 10g Release 1 (10.1) database for 64-bit Windows:
    1 Perform steps 1 - 11 in "Migrating an Oracle Database 10g Release 1 (10.1) Database".
    2 Shut down the database on the 64-bit computer:
    SQL> SHUTDOWN IMMEDIATE;
    3 Start the database migration:
    SQL> STARTUP MIGRATE;
    4 Migrate the database as described in Chapter 3, "Upgrading a Database to the New Oracle Database 10g Release" in Oracle Database Upgrade Guide.
    In step 4, it says, migrate database as described in chapter 3. In chapter 3, it says, to do the upgrade the process using dbca or manually. Pls confirm whether do the upgrade process after issuing startup migrate or not.
    Thanks in advance.

  • Connection between SDM client and server is broken

    Dear All,
    First of all this is what I have
    -NW04 SPS 17
    -NWDS Version: 7.0.09 Build id: 200608262203
    -using VPN connection
    -telnet on port 57018 is succesfull
    I can login to SDM server (from NWDS and from SDM GUI) I can see the state of SDM(green light), restart it, can navigate through tabs in GUI, but every time I am trying to deploy an ear i have this error:
    Deployment exception : Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    Inner exception was :
    Filetransfer failed: Error received from server: Connection between SDM client and server is broken
    I have already read a lot of topics,blogs,notes but didn't find the solution.
    Can anybody help me?
    Best Regards

    Having same issue. Nothing helped so far... Using NWDS 7.0 SP18.
    I have turned SDM tracing on and this is what I see on client side after sending first data package:
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/17 Client: finished sending string part"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0280/0 Client: receive String part from Server"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl.receiveFromServer(NetComm ..): Entering method
    com.sap.bc.cts.tp.net.NetComm.receive(): Entering method
    com.sap.bc.cts.tp.net.NetComm: debug "Method "receive(char[])" could not read all requested bytes. There are still 12 bytes to read"
    com.sap.bc.cts.tp.net.NetComm: debug "Caught IOException during read of header bytes (-1,          43):Connection reset"
    com.sap.bc.cts.tp.net.NetComm: debug "  throwing IOException(net.id_000001)"
    com.sap.bc.cts.tp.net.NetComm.receive(): Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/1 Client: connection was broken"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: debug "20120224140253 0281/0 Client: finshed sendAndReceive"
    com.sap.sdm.is.cs.cmd.client.impl.CmdClientImpl: Exiting method
    My connection on server is still active so I have to restart SDM server to reset and try it again.
    Anyone have idea whats happening?
    Edited by: skyrma on Feb 24, 2012 2:46 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM
    Edited by: skyrma on Feb 24, 2012 2:47 PM

  • Async tcp client and server. How can I determine that the client or the server is no longer available?

    Hello. I would like to write async tcp client and server. I wrote this code but a have a problem, when I call the disconnect method on client or stop method on server. I can't identify that the client or the server is no longer connected.
    I thought I will get an exception if the client or the server is not available but this is not happening.
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    How can I determine that the client or the server is no longer available?
    Server
    public class Server
    private readonly Dictionary<IPEndPoint, TcpClient> clients = new Dictionary<IPEndPoint, TcpClient>();
    private readonly List<CancellationTokenSource> cancellationTokens = new List<CancellationTokenSource>();
    private TcpListener tcpListener;
    private bool isStarted;
    public event Action<string> NewMessage;
    public async Task Start(int port)
    this.tcpListener = TcpListener.Create(port);
    this.tcpListener.Start();
    this.isStarted = true;
    while (this.isStarted)
    var tcpClient = await this.tcpListener.AcceptTcpClientAsync();
    var cts = new CancellationTokenSource();
    this.cancellationTokens.Add(cts);
    await Task.Factory.StartNew(() => this.Process(cts.Token, tcpClient), cts.Token, TaskCreationOptions.LongRunning, TaskScheduler.Default);
    public void Stop()
    this.isStarted = false;
    foreach (var cancellationTokenSource in this.cancellationTokens)
    cancellationTokenSource.Cancel();
    foreach (var tcpClient in this.clients.Values)
    tcpClient.GetStream().Close();
    tcpClient.Close();
    this.clients.Clear();
    public async Task SendMessage(string message, IPEndPoint endPoint)
    try
    var tcpClient = this.clients[endPoint];
    await this.Send(tcpClient.GetStream(), Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async Task Process(CancellationToken cancellationToken, TcpClient tcpClient)
    try
    var stream = tcpClient.GetStream();
    this.clients.Add((IPEndPoint)tcpClient.Client.RemoteEndPoint, tcpClient);
    while (!cancellationToken.IsCancellationRequested)
    var data = await this.Receive(stream);
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(NetworkStream stream, byte[] buf)
    await stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive(NetworkStream stream)
    var lengthBytes = new byte[4];
    await stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await stream.ReadAsync(buf, 0, buf.Length);
    return buf;
    Client
    public class Client
    private TcpClient tcpClient;
    private NetworkStream stream;
    public event Action<string> NewMessage;
    public async void Connect(string host, int port)
    try
    this.tcpClient = new TcpClient();
    await this.tcpClient.ConnectAsync(host, port);
    this.stream = this.tcpClient.GetStream();
    this.Process();
    catch (Exception exception)
    public void Disconnect()
    try
    this.stream.Close();
    this.tcpClient.Close();
    catch (Exception exception)
    public async void SendMessage(string message)
    try
    await this.Send(Encoding.ASCII.GetBytes(message));
    catch (Exception exception)
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.SafeInvoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    private async Task Send(byte[] buf)
    await this.stream.WriteAsync(BitConverter.GetBytes(buf.Length), 0, 4);
    await this.stream.WriteAsync(buf, 0, buf.Length);
    private async Task<byte[]> Receive()
    var lengthBytes = new byte[4];
    await this.stream.ReadAsync(lengthBytes, 0, 4);
    var length = BitConverter.ToInt32(lengthBytes, 0);
    var buf = new byte[length];
    await this.stream.ReadAsync(buf, 0, buf.Length);
    return buf;

    Hi,
    Have you debug these two applications? Does it go into the catch exception block when you close the client or the server?
    According to my test, it will throw an exception when the client or the server is closed, just log the exception message in the catch block and then you'll get it:
    private async void Process()
    try
    while (true)
    var data = await this.Receive();
    this.NewMessage.Invoke(Encoding.ASCII.GetString(data));
    catch (Exception exception)
    Console.WriteLine(exception.Message);
    Unable to read data from the transport connection: An existing   connection was forcibly closed by the remote host.
    By the way, I don't know what the SafeInvoke method is, it may be an extension method, right? I used Invoke instead to test it.
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

Maybe you are looking for