How to create a client console to connect to server in windows service using c#

my code is error
can you check the code please
client console code
partial class Program : ServiceBase
        public static void Main(string[] args)
            serverservice ss = new serverservice();
            ss.myserver();
                TcpClient tcpc = new TcpClient();
                Console.WriteLine("connecting.......");
                tcpc.Connect("10.128.1.116", 80);
                Console.WriteLine("connected........");
                Console.Write("enter msg to be transimitt");
                string str = Console.ReadLine();
                Stream stm = tcpc.GetStream();
                ASCIIEncoding asc = new ASCIIEncoding();
                byte[] ba = asc.GetBytes(str);
                Console.WriteLine("transmitting..........");
                stm.Write(ba, 0, ba.Length);
                byte[] bb = new byte[100];
                int k = stm.Read(bb, 0, 100);
                for (int i = 0; i < k; i++)
                    Console.Write(Convert.ToChar(bb[i]));
                tcpc.Close();
            windows service for server code is
  public partial class serverservice : ServiceBase
        public serverservice()
            InitializeComponent();
        protected override void OnStart(string[] args)
            myserver();
           Thread mythread = new Thread(new ThreadStart(myserver));
             mythread.Start();
        public void myserver()
            char d;
            IPAddress ipad1 = IPAddress.Parse("10.128.1.116");
            TcpListener tcpc = new TcpListener(ipad1, 80);
            tcpc.Start();
           // System.Diagnostics.Process.Start(@"C:\Users\PC\Documents\Visual Studio 2010\Projects\WindowsFormsApplication1\webs\webs\clientconsole\clientconsole\bin\Debug\clientconsole.exe");
            Console.WriteLine("server is running at port 80");
            Console.WriteLine("local end point is" + tcpc.LocalEndpoint);
            Console.WriteLine("waiting for connection");
          // var client=new TestExecutionEngine
            Socket s = tcpc.AcceptSocket();
            Console.WriteLine("connection is accepted from" + s.RemoteEndPoint);
            byte[] b = new byte[100];
            int k = s.Receive(b);
            Console.WriteLine("received");
            for (int i = 0; i < k; i++)
                d = Convert.ToChar(b[i]);
          Console.WriteLine(char.ToUpper(d));
            ASCIIEncoding asc = new ASCIIEncoding();
            s.Send(asc.GetBytes("msg is recveived"));
            Console.WriteLine("\n send aknwldge");
            s.Close();
            tcpc.Stop();
           protected override void OnStop()
            EventLog.WriteEntry("stopped");

kavya --
You have erroneously posted this question in a user forum dedicated to questions about Project Online, an enterprise project management application.  I would recommend you repost your question in a user forum that deals with C sharp programming questions. 
Hope this helps.
Dale A. Howard [MVP]

Similar Messages

  • Client can not connect to Server installed window server 2008 and using 8.8

    HI all!
    I have a problem when Client  log in to server that installed window server 2008.It can not connect to this server even when restart and key in IP or Server name,...
    I try disable Firewall of window 2008 in server machine and client can connect to server. But when i disable firewall, it's mean  i can not use Remote desktop or terminal service..
    Now, how i can do in order to solve this problem.
    Thanks!

    Hi,
    Take a look at the admin guide (Page 75, 119, 159):
    [http://service.sap.com/~sapidb/011000358700000150922010E.zip]
    If you installed a firewall on the license service computer, make sure that the firewall is not set to port 30000; otherwise, the license service cannot work.
    If you are using Port X, make sure that you open Port X and Port (X+1) in the firewall. For example, if you are using port 10000, make sure to also open port 10001.
    The default communication port is 1143.
    The default port of the SAP Business One license server is 30000 for license communication and 30001 for the license naming service

  • How to create a client get security token in STS ?

    Dear all,
    How to create a client get security token in STS(security token service supported by Netweaver7.3) ?
    Thanks.

    Hi Sagarika,
    use scc4 for creating a new client
    and login to the new client that u created using sap* and pass as password
    use sccl over there to do a local client copy
    sccl for copying local client
    scc9 for remote client copy
    Merlin

  • How can I create a client console and work together with the Cache Server?

    How can I edit the following Cache-Server.cmd file to create a client console and work together with the Cache Server?
    The following is the cache server file: contacts-cache-server.cmd
    @echo off
    setlocal
    if (%COHERENCE_HOME%)==() (
    set COHERENCE_HOME=c:\coherence
    set CONFIG=C:\home\oracle\coherence\Contacts
    set COH_OPTS=%COH_OPTS% -server -cp %COHERENCE_HOME%\lib\coherence.jar;C:\home\oracle\
    coherence\Contacts;C:\home\oracle\coherence\Contacts\classes;
    set COH_OPTS=%COH_OPTS% -Dtangosol.coherence.cacheconfig=%CONFIG%\contacts-cache-config.xml
    java %COH_OPTS% -Xms1g -Xmx1g -Xloggc: com.tangosol.net.DefaultCacheServer %2 %3 %4 %5 %6 %7
    :exitEdited by: junez on 23-Oct-2009 09:20

    Hi
    To run the console, change DefaultCacheServer to CacheFactory
    Paul

  • How to create cross-client variant?

    Hi Experters:
    Can someone tell me how create cross-client variant in ECC6.0?
    in 4.6, we can define the client or define cross-client transaction variant,
    how to create cross-client variant in ECC6.0?
    Regareds,

    Hi,
    In se93 there is a check box cross-client .
    The Cross-client switch identifies which transaction variants are cross-client and which are client-specific. If the switch is set, the transaction variant is cross-client. If the switch is not set, the transaction variant is client-specific.
    A client-specific transaction variant can only exist in the client where it was created. The field contents of the transaction variant only have to be available in the particular client. A cross-client transaction variant is available in the system regardless of which client is currently active. The field contents of the transaction variant have to be available in all clients.
    http://****************/Tutorials/ABAP/TransactionVariant/Create.htm

  • How to create new client in XI

    Hi all,
      Can any one guide me how to create new client in XI.

    Hi
    To set up a new client, follow these steps
    1) Create a client going in to the path
    <b>Tools->Administration ->Administration -> Client administration -> Client maintenance</b>
    or can also use TCODE <b>scc4</b>
    2)Login into the client with
    User: <b>DDIC</b> or <b>SAP*</b>
    Password
    For default password go thru this link
    http://help.sap.com/saphelp_nw04/helpdata/en/52/67179f439b11d1896f0000e8322d00/content.htm
    Regards
    Arpit Seth

  • How to create a client

    hi,
    please let me know the details on how to create a client in solutiona manager service desk

    The reporting user needs a business partner in Solution Manager (BP_GEN / BP)
    Further more you need to maintain business partner identification tab for that user in tx: BP
    External BP number:
    CRM001   "<SID> <Installation Number> <Client> <User>" 
    For instance:
    CRM001 "ABC 1234567890 100 VSHAN"
    /cheers

  • How to create a client other than 800 in sap 4.7E version?

    helo can any body tell how to create another client in 4.7 version?points r assured.

    Hi Sagarika,
    use scc4 for creating a new client
    and login to the new client that u created using sap* and pass as password
    use sccl over there to do a local client copy
    sccl for copying local client
    scc9 for remote client copy
    Merlin

  • "How to create new client in ABAP sneek Preview "

    HI ,
             Can anybody tell me how to create new client in ABAP sneek preview , i had  create  a new client 100 and tried to enter with Cilent 100. User : SAP* , and Password : pass. But i'm unable to log into the sap system.

    Hello,
    perhaps this will help you --> <a href="http://www.sap-img.com/bc049.htm">instructions</a>
    And this quote from another thread:
    <i>in SAPNW2004sSneakPreviewABAP this procedure only works if the system <b>profile parameter login/no_automatic_user_sapstar is set to 0</b> (and the system restarted after that), otherwise you will have a new client without any user thus useless ;-).</i>
    Regards,
    Norman

  • How to create database link from oracle to sql server

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal

    Please help with how to create database link from oracle to sql server
    Best regards,
    Vishal
    Hi Vishal,
    I found a lof of information regarding how to create a database link from Oracle to SQL Server, please see:
    https://www.google.co.in/?gws_rd=cr&ei=vd3XUvGFO8TgkAXqlYCADg#q=how+to+create+database+link+from+oracle+to+sql+server
    We discuss SQL Server related issue in this forum. If you have any more question regarding Oracle, please post it in Oracle communities forum for better support.
    Regards,
    Elvis Long
    TechNet Community Support

  • How to create a form and show it as a modal window in VB6?

    oform.modal  -> modal is read-only property
    help,please.

    Hi Santiago!
    HTH: How to create a form and show it as a modal window?

  • How  To create a new word document and to serve bookmarks

    how To create a new word document and to serve bookmarks

    there is an example :
    http://www.must.de/default.html?Javactpe.htm
    howerver ,I don't kown how to use in jsp!!

  • How to disable automatic delivery of Internet Explorer 10/11 in Windows 7, using "Internet Explorer 10/11 Blocker Toolkit"

    How
    to disable automatic delivery of Internet Explorer 10/11 in Windows 7, using "Internet Explorer 10/11 Blocker Toolkit"

    How to disable automatic delivery of Internet Explorer 10/11 in Windows 7, using "Internet Explorer 10/11 Blocker Toolkit"
    http://answers.microsoft.com/en-us/ie/wiki/ie11-windows_7/how-to-disable-automatic-delivery-of-internet/66116734-6698-4456-a5f1-5ff085eb0af9

  • How to create a model and JCO connection

    Hi all,
             The Userid and Password given while creating new model at Singleserver/Load balancing tab should be same as the userid and password given while creating JCO connection. i.e in JCO creation  while mapping modeldata to Application data and Metadata to metadata we will give some userid and password.
    will those 2 userids and passwords should be same.
    the error which i am getting is
    com.sap.tc.webdynpro.modelimpl.dynamicrfc.WDDynamicRFCExecuteException: Error connecting using JCO.Client: null
    Regards
    Padma N

    2 userids and passwords need not be same
    i got similar problem and this is how i resolved
    this is because jco connections are Using SSO and the user who is accessing that webdynpro application is not present in the backend system.
    please make sure user is there in the backend system from which you are getting data
    xxxxxxxxxxxxxxxxxxxxx
    Edited by: Armin Reichert on Feb 18, 2008 7:26 PM

  • How to create a client jar file???

    How do I create a client jar file for the client program? Please see my attached
    ejb-jar.xml. I compiled the my EJB and deployed it successfully. However, I couldn't
    find the client jar anywhere. I use the weblogic admin console DD editor, I can
    see that the edit field has been populated with my client jar file name defined
    in the ejb-jar.xml. However, I searched entire system, I could not locate this
    jar anywhere.
    How do I do that? If someone knows how to do it, please let me know. Thank you
    very much.
    [ejb-jar.xml]

    How do I create a client jar file for the client program? Please see my attached
    ejb-jar.xml. I compiled the my EJB and deployed it successfully. However, I couldn't
    find the client jar anywhere. I use the weblogic admin console DD editor, I can
    see that the edit field has been populated with my client jar file name defined
    in the ejb-jar.xml. However, I searched entire system, I could not locate this
    jar anywhere.
    How do I do that? If someone knows how to do it, please let me know. Thank you
    very much.
    [ejb-jar.xml]

Maybe you are looking for