Connecting Tech Pros Worldwide Help | Site Map

TcpClient or TCP/IP Connections

Mythran
Guest
 
Posts: n/a
#1: Nov 20 '05
I am quite familiar with C/C++ network handling on *nux boxes and it's
blocking/non-blocking I/O. What I need to do in VB.Net is very similar. I need
to take a single server application and allow up to 500 users to connect to this
application remotely using TCP/IP. Once a connection has been made, it must
process data every few milliseconds and check all connections (one at a time or
through an event somehow) for user-entered text.

This application will probably be telnetted into so it must allow for the text to
be sent at once, not single-character at a time.

The problem I am having is once a client connects to the server, the applications
stops until the user sends data, once data is received, the application loops
once and waits again. I believe I need to start a new thread which will allow
the application to wait for the user to enter data while still checking server
side events and handling it's job synchronously.

This sounds like something from a chat, so if I can get a basic chat program
using threading, that would be nice...another similar app would be a multi-player
game that I can "legally" view the code for.

Thanks a bundle!

Mythran


Mike Bulava
Guest
 
Posts: n/a
#2: Nov 20 '05

re: TcpClient or TCP/IP Connections


Instead of using TCPClient.GetStream.Read to read the Data once the
Connection is Established Use BeginRead That's a threaded operation that
will execute a Sub once the the entire stream is sent.

"Mythran" <kip_potter@hotmail.com> wrote in message
news:OCPX8gJ1DHA.536@tk2msftngp13.phx.gbl...[color=blue]
> I am quite familiar with C/C++ network handling on *nux boxes and it's
> blocking/non-blocking I/O. What I need to do in VB.Net is very similar.[/color]
I need[color=blue]
> to take a single server application and allow up to 500 users to connect[/color]
to this[color=blue]
> application remotely using TCP/IP. Once a connection has been made, it[/color]
must[color=blue]
> process data every few milliseconds and check all connections (one at a[/color]
time or[color=blue]
> through an event somehow) for user-entered text.
>
> This application will probably be telnetted into so it must allow for the[/color]
text to[color=blue]
> be sent at once, not single-character at a time.
>
> The problem I am having is once a client connects to the server, the[/color]
applications[color=blue]
> stops until the user sends data, once data is received, the application[/color]
loops[color=blue]
> once and waits again. I believe I need to start a new thread which will[/color]
allow[color=blue]
> the application to wait for the user to enter data while still checking[/color]
server[color=blue]
> side events and handling it's job synchronously.
>
> This sounds like something from a chat, so if I can get a basic chat[/color]
program[color=blue]
> using threading, that would be nice...another similar app would be a[/color]
multi-player[color=blue]
> game that I can "legally" view the code for.
>
> Thanks a bundle!
>
> Mythran
>
>[/color]


Glenn Wilson
Guest
 
Posts: n/a
#3: Nov 20 '05

re: TcpClient or TCP/IP Connections


I saw an exaple on planet soure code that was called
opentelnet that would help in your situation

It handles multiple connections and sends and recieves
streams.

<planet-source-code.com>

Glenn
[color=blue]
>-----Original Message-----
>I am quite familiar with C/C++ network handling on *nux[/color]
boxes and it's[color=blue]
>blocking/non-blocking I/O. What I need to do in VB.Net[/color]
is very similar. I need[color=blue]
>to take a single server application and allow up to 500[/color]
users to connect to this[color=blue]
>application remotely using TCP/IP. Once a connection[/color]
has been made, it must[color=blue]
>process data every few milliseconds and check all[/color]
connections (one at a time or[color=blue]
>through an event somehow) for user-entered text.
>
>This application will probably be telnetted into so it[/color]
must allow for the text to[color=blue]
>be sent at once, not single-character at a time.
>
>The problem I am having is once a client connects to the[/color]
server, the applications[color=blue]
>stops until the user sends data, once data is received,[/color]
the application loops[color=blue]
>once and waits again. I believe I need to start a new[/color]
thread which will allow[color=blue]
>the application to wait for the user to enter data while[/color]
still checking server[color=blue]
>side events and handling it's job synchronously.
>
>This sounds like something from a chat, so if I can get[/color]
a basic chat program[color=blue]
>using threading, that would be nice...another similar[/color]
app would be a multi-player[color=blue]
>game that I can "legally" view the code for.
>
>Thanks a bundle!
>
>Mythran
>
>
>.
>[/color]
Closed Thread