TCP/IP Socket communication from multiple clients

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Rotzooi

    #1

    TCP/IP Socket communication from multiple clients

    Hi,

    In the past I created a VB6 application that was capable of accepting
    multiple client connections for status logging over the internet using
    simple non-Windows clients (GSM/GPRS). There is one management
    console/monitor that receives messages and keeps track of keep-alive
    polling. The monitor created a new WinSock connection for each client that
    logged on. These were put into an array of controls. I'm sure this can also
    be done with VB.NET.

    I want to convert this application to VB.NET using VS2005 and the .NET
    Framework 2.0. But I run into several problems. Are there any good examples
    of GUI examples on sites to study on so I can convert my application
    succesfully (most of it is converted, except the communication). Most sites
    show samples as console apps and simply copy-paste doesn't work (100% CPU
    load and crashing).


    Jeroen



  • m.posseth

    #2
    Re: TCP/IP Socket communication from multiple clients


    rotzooi ( freely translated to crappy ,,,,,,, i hope you are not
    refering to this groups answers ) ???

    I believe that the biggest problem of a lot of people who are rewriting VB6
    proggy`s to .Net is that they not look to the new technologies that .Net has
    to offer
    ( why would you rewrite the project then is my question )

    why not use a webservice for the web comunication part ?? opr choose another
    new aproach as simply rewriting the VB6 code


    instead of the winsock control you can now use a suitable framework class
    ( tcpclient , udpclient ) and yes you can create arrays of them

    regards

    Michel Posseth [MCP]


    "Rotzooi" <rotzooi@bukowo nen.nl> schreef in bericht
    news:uIUwtH$LGH A.2040@TK2MSFTN GP14.phx.gbl...[color=blue]
    > Hi,
    >
    > In the past I created a VB6 application that was capable of accepting
    > multiple client connections for status logging over the internet using
    > simple non-Windows clients (GSM/GPRS). There is one management
    > console/monitor that receives messages and keeps track of keep-alive
    > polling. The monitor created a new WinSock connection for each client that
    > logged on. These were put into an array of controls. I'm sure this can
    > also be done with VB.NET.
    >
    > I want to convert this application to VB.NET using VS2005 and the .NET
    > Framework 2.0. But I run into several problems. Are there any good
    > examples of GUI examples on sites to study on so I can convert my
    > application succesfully (most of it is converted, except the
    > communication). Most sites show samples as console apps and simply
    > copy-paste doesn't work (100% CPU load and crashing).
    >
    >
    > Jeroen
    >
    >
    >[/color]


    Comment

    • Rotzooi

      #3
      Re: TCP/IP Socket communication from multiple clients

      Thanks for the reply.

      My newly written app is based on the functionality of the VB6 version, but
      it's a complete remake. The reason for using simple socket communication is
      that many status reports use a GPRS mobile connection (field units powered
      by a battery and solar cell) and payment for the mobile services is for the
      traffic used. So a single byte to verify the connection and send the staus
      is enough (pretty much light weight). I would like to use XML or other
      webbased services, but they generate an awfull lot of overhead.

      I've had a look at the many samples about tcpClient and the
      System.Net.Sock ets but my biggest problem is building the array with socket
      connections (multiple clients connecting at the same time).


      Jeroen


      "m.posseth" <posseth@planet .nl> schreef in bericht
      news:elfGaz$LGH A.1180@TK2MSFTN GP09.phx.gbl...[color=blue]
      >
      > rotzooi ( freely translated to crappy ,,,,,,, i hope you are not
      > refering to this groups answers ) ???
      >
      > I believe that the biggest problem of a lot of people who are rewriting
      > VB6 proggy`s to .Net is that they not look to the new technologies that
      > .Net has to offer
      > ( why would you rewrite the project then is my question )
      >
      > why not use a webservice for the web comunication part ?? opr choose
      > another new aproach as simply rewriting the VB6 code
      >
      >
      > instead of the winsock control you can now use a suitable framework class
      > ( tcpclient , udpclient ) and yes you can create arrays of them
      >
      > regards
      >
      > Michel Posseth [MCP]
      >
      >
      > "Rotzooi" <rotzooi@bukowo nen.nl> schreef in bericht
      > news:uIUwtH$LGH A.2040@TK2MSFTN GP14.phx.gbl...[color=green]
      >> Hi,
      >>
      >> In the past I created a VB6 application that was capable of accepting
      >> multiple client connections for status logging over the internet using
      >> simple non-Windows clients (GSM/GPRS). There is one management
      >> console/monitor that receives messages and keeps track of keep-alive
      >> polling. The monitor created a new WinSock connection for each client
      >> that logged on. These were put into an array of controls. I'm sure this
      >> can also be done with VB.NET.
      >>
      >> I want to convert this application to VB.NET using VS2005 and the .NET
      >> Framework 2.0. But I run into several problems. Are there any good
      >> examples of GUI examples on sites to study on so I can convert my
      >> application succesfully (most of it is converted, except the
      >> communication). Most sites show samples as console apps and simply
      >> copy-paste doesn't work (100% CPU load and crashing).
      >>
      >>
      >> Jeroen
      >>
      >>
      >>[/color]
      >
      >[/color]


      Comment

      • cj

        #4
        Re: TCP/IP Socket communication from multiple clients

        Rotzooi,

        I'm just getting started on a very similar project. I'm new to .net and
        have been asking questions here too. It would seem the way to make a
        TCP/IP server in .net is using threading instead of an array. It took
        quite a bit to get my mind around it but actually it seems pretty
        simple. This article was helpful to me on threading
        ' Clear the IE's HistorySub ClearIEHistory() Dim keyName As String = "SoftwareMicrosoftInternet ExplorerTypedURLs" ' delete the key that contains the URLs


        For the communications I'll be using SocketWrench which is part of the
        Socket Tools package written by http://www.catalyst.com/ I even got a
        sample program for .net that shows how to set up a echo server that
        accepts multiple simultaneous connects. I seem to have misplaced the
        link but if you want it let me know and I'll try to find it.

        While I'm using purchased software, there is a free version. Some info
        on it can be found here
        http://www.catalyst.com/products/soc...ial/index.html


        Rotzooi wrote:[color=blue]
        > Hi,
        >
        > In the past I created a VB6 application that was capable of accepting
        > multiple client connections for status logging over the internet using
        > simple non-Windows clients (GSM/GPRS). There is one management
        > console/monitor that receives messages and keeps track of keep-alive
        > polling. The monitor created a new WinSock connection for each client that
        > logged on. These were put into an array of controls. I'm sure this can also
        > be done with VB.NET.
        >
        > I want to convert this application to VB.NET using VS2005 and the .NET
        > Framework 2.0. But I run into several problems. Are there any good examples
        > of GUI examples on sites to study on so I can convert my application
        > succesfully (most of it is converted, except the communication). Most sites
        > show samples as console apps and simply copy-paste doesn't work (100% CPU
        > load and crashing).
        >
        >
        > Jeroen
        >
        >
        >[/color]

        Comment

        • olympics

          #5
          Re: TCP/IP Socket communication from multiple clients

          thanks


          Comment

          • cj

            #6
            Re: TCP/IP Socket communication from multiple clients

            Found the link I misplaced. Here it is. This post is by a Catalyst
            employee and he writes a step by step example of a multithreaded echo
            server in this post.



            cj wrote:[color=blue]
            > Rotzooi,
            >
            > I'm just getting started on a very similar project. I'm new to .net and
            > have been asking questions here too. It would seem the way to make a
            > TCP/IP server in .net is using threading instead of an array. It took
            > quite a bit to get my mind around it but actually it seems pretty
            > simple. This article was helpful to me on threading
            > http://www.devx.com/DevX/10MinuteSol...5/1954?pf=true
            >
            > For the communications I'll be using SocketWrench which is part of the
            > Socket Tools package written by http://www.catalyst.com/ I even got a
            > sample program for .net that shows how to set up a echo server that
            > accepts multiple simultaneous connects. I seem to have misplaced the
            > link but if you want it let me know and I'll try to find it.
            >
            > While I'm using purchased software, there is a free version. Some info
            > on it can be found here
            > http://www.catalyst.com/products/soc...ial/index.html
            >
            >
            > Rotzooi wrote:[color=green]
            >> Hi,
            >>
            >> In the past I created a VB6 application that was capable of accepting
            >> multiple client connections for status logging over the internet using
            >> simple non-Windows clients (GSM/GPRS). There is one management
            >> console/monitor that receives messages and keeps track of keep-alive
            >> polling. The monitor created a new WinSock connection for each client
            >> that logged on. These were put into an array of controls. I'm sure
            >> this can also be done with VB.NET.
            >>
            >> I want to convert this application to VB.NET using VS2005 and the .NET
            >> Framework 2.0. But I run into several problems. Are there any good
            >> examples of GUI examples on sites to study on so I can convert my
            >> application succesfully (most of it is converted, except the
            >> communication). Most sites show samples as console apps and simply
            >> copy-paste doesn't work (100% CPU load and crashing).
            >>
            >>
            >> Jeroen
            >>
            >>
            >>[/color][/color]

            Comment

            Working...