473,412 Members | 1,921 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,412 software developers and data experts.

Multithread Winsock

Hi all
I am a newbie to VB.NET hence I would like some help or pointers as to a way of developing the following:

A server which listens on a particular port for incoming client connection.
Upon receiving a connection the server starts to process data for that client and sends it back. In terms of data it will be a connection to Oracle, but for the purpose of this post it can be anything I.e. send 1000 numbers back etc.

Now

I would like multiple connections and multiple processes to begin for eg
CLIENT 1 connects the server starts of the data preparation for CLIENT 1
CLIENT 2 Connects the server starts of the data preparation for CLIENT 2
While the data is being prepared for CLIENT 2 CLIENT 1 data is ready and is being sent to CLIENT 1.
CLIENT 3 connects and data preparation starts for CLIENT 3 etc etc

I would like this things to happen simultaneously and not parallel.

hope it is clear

I would appreciate any help

TIA
N
Nov 20 '05 #1
2 1434
In article <3f***********************@auth.uk.news.easynet.ne t>, N.Naeem wrote:
This is a multi-part message in MIME format.

------=_NextPart_000_0016_01C3AEB8.81687D30
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Hi all
I am a newbie to VB.NET hence I would like some help or pointers as to a =
way of developing the following:

A server which listens on a particular port for incoming client =
connection.
Upon receiving a connection the server starts to process data for that =
client and sends it back. In terms of data it will be a connection to =
Oracle, but for the purpose of this post it can be anything I.e. send =
1000 numbers back etc.

Now=20

I would like multiple connections and multiple processes to begin for eg
CLIENT 1 connects the server starts of the data preparation for CLIENT 1
CLIENT 2 Connects the server starts of the data preparation for CLIENT =
2
While the data is being prepared for CLIENT 2 CLIENT 1 data is ready and =
is being sent to CLIENT 1.
CLIENT 3 connects and data preparation starts for CLIENT 3 etc etc

I would like this things to happen simultaneously and not parallel.

hope it is clear

I would appreciate any help=20

TIA
N =20
------=_NextPart_000_0016_01C3AEB8.81687D30
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=3DContent-Type content=3D"text/html; =
charset=3Diso-8859-1">
<META content=3D"MSHTML 6.00.2800.1276" name=3DGENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY>
<DIV><FONT size=3D2>Hi all</FONT></DIV>
<DIV><FONT size=3D2>I am a newbie to VB.NET hence I would like some help =
or=20
pointers as to a way of developing the following:</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>A server which listens on a particular port for =
incoming=20
client connection.</FONT></DIV>
<DIV><FONT size=3D2>Upon receiving a connection the server starts to =
process data=20
for that client and sends it back.&nbsp; In terms of data&nbsp;it will =
be a=20
connection to Oracle, but for the purpose of&nbsp;this post it can be =
anything=20
I.e. send 1000 numbers back etc.</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>Now </FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I would like multiple connections and multiple =
processes to=20
begin for eg</FONT></DIV>
<DIV><FONT size=3D2>CLIENT 1 connects the server starts&nbsp;of the data =

preparation for CLIENT 1</FONT></DIV>
<DIV><FONT size=3D2>CLIENT 2 Connects the server =
starts&nbsp;&nbsp;&nbsp;of the=20
data preparation for CLIENT 2</FONT></DIV>
<DIV><FONT size=3D2>While&nbsp;the data is being prepared for CLIENT 2 =
CLIENT 1=20
data is ready and is being sent to CLIENT 1.</FONT></DIV>
<DIV><FONT size=3D2>CLIENT 3 connects and data preparation starts for =
CLIENT 3 etc=20
etc</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I would like this things to happen simultaneously =
and not=20
parallel.</FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV><FONT size=3D2>hope it is clear</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>I would appreciate any help&nbsp;</FONT></DIV>
<DIV><FONT size=3D2></FONT>&nbsp;</DIV>
<DIV><FONT size=3D2>TIA<BR>N&nbsp;&nbsp;</FONT></DIV>
<DIV><FONT size=3D2><BR></FONT>&nbsp;</DIV></BODY></HTML>

------=_NextPart_000_0016_01C3AEB8.81687D30--


Probably the best place to start would be here:

http://msdn.microsoft.com/library/de...ientsocket.asp

Especially pay attention to the topics on Asynchronous clients and
servers (under "Listening with Sockets"). Using Asychrounous Sockets is
probably the most efficient way to do what you want to do - especially
on NT based systems. Also, it removes a lot of the burden of thread
management (though, you still have to worry about syncronization, etc).

--
Tom Shelton
MVP [Visual Basic]
Nov 20 '05 #2
Hi,

There is an example that does exactly this at:

http://msdn.microsoft.com/vbasic/dow...es/default.asp

--
Richard Grier (Microsoft Visual Basic MVP)

See www.hardandsoftware.net for contact information.

Author of Visual Basic Programmer's Guide to Serial Communications, 3rd
Edition ISBN 1-890422-27-4 (391 pages) published February 2002.
Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Bill | last post by:
When vb6 Winsock.RemoteHost is set to "127.0.0.1", c# socket listener cannot hear connect request (my old vb6 winsock listener could hear it...). Why doesn't this work, and is there a work...
1
by: Yu Chai | last post by:
Hi guys, I created a ASP page that 1. users can run when WinSock proxy are using (ie's one is unchecked) 2. users can't run when WinSock proxy are using (ie's one is checked) 3. users can't run...
0
by: r_obert | last post by:
Hello, I'm trying to create a worker thread for my VC++ program, and was wondering whether I should be linking with the Multithread /MT or Multithread DLL /MD option? I'm not quite sure, in...
7
by: Nadav | last post by:
Hi I am writing some kind of a storage system that have to deal with large amounts of data passing over the net, Now, I Wonder... traditional programming would use win32 Winsock DLL as the means...
4
by: zbcong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting for a...
2
by: zhebincong | last post by:
Hello: I write a multithread c# socket server,it is a winform application,there is a richtextbox control and button,when the button is click,the server begin to listen the socket port,waiting...
5
by: kc | last post by:
Hi Just upgrading a app from VB6 to VB.Net. All is going well apart from the Winsock control. The first thing we notice is that there does not appear to be a .Net version (please correct me if...
6
by: jmartin | last post by:
Hi, I have made a multithread version of a program (load a file into database), and with two processors I get the double of time in the multithread than in the process (unithread) version. I...
1
by: Nicolas Ghesquiere | last post by:
Hello I have a problem with my current program. The meaning of the program is to allow users to login to a server to allow them to access the internet. My program communicates with a MS isa...
3
AaronL
by: AaronL | last post by:
Hello, I am currently working on a project that has me in sort of a bind. What I want to do is retrieve web pages from the internet, and strip them down to just text. I'll get using Regular...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.