Multiple Socket Connections?

Nov 14, 2010

OK here is some code I nicked from web and I have changed some things, it works but only accepting one client, how do I make this accept multiple clients?

[Code]...

View 2 Replies


ADVERTISEMENT

Multiple Socket Connections Per Thread?

Sep 8, 2011

We are using VB.NET 2010. Our application receives client connection through socket, and currently each client has its own thread and socket. We would like to have multiple socket connections per thread, but we are having a problem doing it.

Below is our current program where each client has itsown tread and socket.
Public class frmMyForm:
Private Sub AcceptSocket(ByVal Sock As SocketTools.SocketWrench)
Try
Dim oSession As SessionClass
Dim oThread As Threading.Thread
[Code] .....

View 1 Replies

Multiple Socket Connections - Address Of Parameters?

Mar 2, 2012

I am writing a socket client into my application. I have multiple socket connections to make to different servers.
ClientSocket(1).BeginConnect(endpoint1, AddressOf Connected, Nothing)
ClientSocket(2).BeginConnect(endpoint2, AddressOf Connected, Nothing)
Both clients call the connected sub... how do I know which one is which?
Private Sub Connected(ByVal ar As IAsyncResult)

View 3 Replies

Threading And Socket Connections Approach

Jul 2, 2011

Im writing a small application that need to make up to 300 socket connections at the same time. However i'm pretty confused on how to approach this. My first theory is to have my main thread to manually fire up 300 new threads that each handle all that needs to be done. Another theory is to fire up lets say 10 threads that makes 30 async connections. My last theory is to have my mainthread work with all 300 async connections together with everything else. The question to this is what would be the most effective way to go to save resources and maintain speed.

View 1 Replies

VS 2008 Async Socket Connections - Clear Out No Longer Useful Sockets From The Server?

Dec 18, 2009

I have been developing an async socket connection server and client program. I have been testing it, and noticed that if I connect to the server from my client and then disconnect. Upon reconnecting I am on a different port(local IP still). This is fine, however when I go to send a message, and the server trys to update all the clients, it eventually hits clients that do not exist anymore. I get the SocketException 10054, and upon connecting/disconnecting enough, it no longer works at all. My question is how do I clear out these no longer useful sockets from the server? I am doing currentsocket.Shutdown(SocketShutDown.Both); and then a currentsocket.Close(); after that. When a user disconnects.

[Code]...

View 1 Replies

Communicate From Client To Server From Multiple Clients On Multiple Requests In Socket Programming?

Jan 8, 2010

I have been struggling to find a solution for this problem. What I need to do is build a server application that accepts tcp client requests from different clients running on same port say:1003. I experimented by using asynchronous mode call backs etc. but it disconnects once connection is established and does not respond for further requests from the same client.

View 1 Replies

Open Multiple Socket Connects To Multiple Servers

Apr 4, 2012

i have a form where i wanted to open multiple socket connects to multiple servers. i defined "clientsocket" as a socket array

[Code]...

View 6 Replies

.NET - DataGridView - Multiple Connections And Queries?

Oct 8, 2010

I am new(ish) to Visual Basic and i have learned from looking at old VB6 code for programs that have been made for us in the past, this includes using the old ADODB connections and FlexGrids which both have been changed in VB.Net to OLEDB and DataGridView.I have started to understand the way the connections and datasets etc are created but i am struggling to get to where i was with the old code (I am trying to completely upgrade the code from FlexGrid).This is the VB6 Code i am trying to upgrade from:

[Code]...

View 14 Replies

Sql - Multiple Database Connections Within 1 Application - .NET?

Mar 16, 2012

This may have been answered but my search hasn't found what I was looking for. Basically, I am developing an application which allows the user to build a query at design time, i.e. for users with no prerequisite knowledge of SQL The application thus far allows the user to select which table(s) from the database they wish to start querying (I won't go into the details of the rest for now)

My confusion is this; I already have the connection to the database in a subroutine which obtains the schema information and filters it to display only the available tables within the database, which then compiles the data into a listbox, here is that sub:

[Code]...

View 1 Replies

C# - Disable Multiple Network Connections, Only Allow One Simultaneously?

Feb 17, 2011

We are looking to design a security application that does the following on laptops:If the ethernet adapter is used (cable plugged in) disable/block all other network connections (wireless WIFI, mobile broadband (PPP), virtual VPN adapters etc)When ethernet adapter is not being used again, all connections allowed.We have looked in the WMI a lot but there are no good ways of doing this. Only disabling the network connection is not secure enough because most mobile broadband applications try to re-establish the connection. This should be an application that works on all laptop vendors without any user interaction (such as choosing interfaces etc..).

View 3 Replies

VS 2010 : Multiple Connections To Single Webcam?

Nov 11, 2011

I have written a program that uses directshowlib to capture a stream from a webcam and save as an AVI whenever a bird lands on the experiment platform for behavioral research. What I would like is to be able to allow another program or connection to the same webcam at the same time simply for preview purposes, is this possible?

Basically I want my app to still be able to record on demand when a bird interacts but I would also like a IP cam program like webcamXP/Webcam7 to be able to stream a live feed to the internet so we can have a live view of the platform. I had found some articles about connecting multiple streams from one webcam but am not sure how to go about it. If I have to I will simply mount a 2nd cam in the Bird colony and dedicate it to the web stream but if I can use the same cam as the recording cam that would be great.

View 2 Replies

Instantiate Multiple Sql Connections To The Same Database Via Threading Without Getting An Error?

Apr 8, 2011

I'm running a program where I call a function which creates a database connection and then runs a stored procedure. I call this function four times from four separate threads. I get an error (Login failed for user 'sa'. The user is not associated with a trusted SQL Server connection.

Exception Source:
.Net SqlClient Data Provider)
when I use multiple threads, but if I have the threads run one after another I have no

[code].....

View 1 Replies

Cyberproj - Connections From Multiple Clients To A Server Having Winsock Control

May 17, 2010

I am developing project on cyber cafe using vb .net 2005 and winsock i don't know how to accept connections from multiple clients to a server having winsock control

View 2 Replies

.Net SQLClient Connections And SQL Server - Active Connections Reflect Even Though All Closed?

Jul 19, 2011

Using VB.Net and SQL Server 2008 R2: I have recently had a database that using sp_who2 reflects a connection ".Net SqlClient Data Provider" is still active even though the .Net application has closed and disposed of all connections.

[Code]...

View 1 Replies

Managing Multiple Client Socket Connection?

Sep 11, 2011

Am developing a server - client application using the system.net class , that will have more than 5000 simultenous client connection.what is the best way to manage multiple client connection like this?

View 3 Replies

Identify Connection Lost Between Socket Server And Socket Client?

May 21, 2011

I wrote a Socket Client which will send the Socket Server some data and get some response from Server. This process will be running once in every 2 seconds.

Now what I need to know is How we can identify the connection lost between Server and Client?

I need this to be implemented in the Client side. If there is no connection then Client should automatically close the connection. Once the connection with the server is available in the next attempt it should connect automatically.

View 1 Replies

Client Socket - Send Message Through Client Socket Receive Specified Argument Was Out Of Range Of Valid Values

Oct 15, 2011

Below is my code, but when i send the message thru client socket i receive Specified argument was out of the range of valid values. Parameter name: size

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Dim serverStream As NetworkStream = clientSocket.GetStream()
Dim outStream As Byte() = _
System.Text.Encoding.ASCII.GetBytes("0800822000000000000004000000000000000920092126012345001")

[CODE]...

View 1 Replies

Sql - Ado.net Managing Connections

Jun 6, 2010

I'm populating a listview with a list of databases on a selected SQL instance, then retrieving a value from each database (It's internal product version, column doesn't always exist) I'm calling the below function to populate the second column of the listview:

[Code]...

View 2 Replies

Threading And Db Connections In Vb?

Feb 23, 2011

I'm trying to understand how to handle db connections in a multi-theaded windows program.It I have this simple class:

public class MyClass
private myConn as new sqlconnection
private MyThreadPool(5) as Thread

[code]....

View 10 Replies

Two Connections Under One Transaction

May 24, 2012

I searched araound and having some difficulties in implementing one scenario with SQL Server 2000 and sybase.I have two SQL servers on different locations naming ServerA (MSSQL Server) and ServerB (Sybase server).I have a table called SALARY.Whenever I insert one record to customer SALARY in ServerA, I also will insert it into ServerB.If should any of them failed, both of them should be rolled back.I am using Asp .Net with VB for the programming.I do not have the right to change / add table in Server B. The only thing allowed in Server B is insert/delete/update record.I looked around and find a method to use TransactionScope but I am not quite sure it is the right way to do.url...

View 1 Replies

Using TCP To Listen For Connections

Dec 17, 2010

I am developing an Application that uses TCP To listen for connections, and then when a message is sent to the server and then it alerts the IP that is running the server. (Lets say the server is on a iPhone, and some how the iPhone gets a text message, which alerts a tcp server running in the background via a .jar, it would send the owner of the iPhone a message on the computer telling it it has a text. This is just an example though, but I think it gets the general idea across. I've been trying to do this, and I can connect to a TCP Server (using 127.0.0.1:8888 for testing purposes, will move to a solid IP and Port later). I can start the server (its still buggy and under development) but i don't know how to connect to the server via an application, and when a certain message is received to alert the IP Running the server.

My Server Code is:
Dim serverSocket As New TcpListener(8888)
Dim clientSocket As TcpClient
Dim infiniteCounter As Integer
Dim counter As Integer
serverSocket.Start()
[Code] .....

Now I know that to connect you'd do something like
Code:
Dim clientSocket As New System.Net.Sockets.TcpClient()
Dim serverStream As NetworkStream
clientSocket.Connect("127.0.0.1", 8888)
serverStream = clientSocket.GetStream()
And I know I would have to use some sort of Byte() method to send/receive messages, but I am at a loss on how to set it all up.

View 3 Replies

Best Way For Concurrent HTTP Connections?

Apr 22, 2010

I need to download a bunch of pages from a web server, ie. spidering. I know that servers are typically configured to only allow a couple of concurrent connections from a given IP, but that would already halve the total time to run the script instead of downloading one page at a time.

View 4 Replies

Classes And Connections To The Database?

Jul 28, 2009

i've been previously using Visual Studios built in wizards for manipulating data access to and from an MSAccess Database, however just recently i coded my own classes and connections to the database, ive been able to select, update and delete records effectively however my problem comes with inserting records.

I have a 3 tiered table database:Tbl_PO, Tbl_Parts, Tbl_Shipments each po has multiple parts, each part has multiple shipments.when i insert a record into the tbl_PO, i need to retrieve the ID used on that insertion.

View 4 Replies

Closing All (maybe Older) SQL Connections?

Feb 15, 2012

I am using two SQL connections in my Program. I declare them like this:

Public SQLcon As New SqlConnection("server=(local);database=master;Trusted_Connection=True;")

[code].....

View 5 Replies

Closing Connections On Redirect?

Feb 20, 2010

How do I go about closing a connection if I redirect before I can close it? Does it close when the new page loads? For example:

[code].....

View 3 Replies

Code For Connections Between Points?

Aug 14, 2009

This thread (Question) is a continuation of a question answered by JohnWein. the original question asked by me in this thread:http://social.msdn.microsoft.com/Forums/en-US/vbgeneral/thread/4d9b44a0-91ed-4f64-a3a2-74afffce2256 an this is the answer:

[Code]...

The question is, in the case of four connections, how can I make sure that all points are connected with minimum number of connections using the same above code?

View 1 Replies

Connections: Opened And Closed?

Nov 7, 2011

I have a Visual Studio 2008-SQL Server 2005 app that will be throwing alot at it. It's my testbed learning app. I'm also a student of this craft(43 years young) like another poster posted on another thread. I come from a PICK/BASIC jBase background. Anyway as-is my app has a connection to the database that is opened on form load. I close the connection on form close. It's a one form app currently. Is this wrong? It seems that maybe I should not have a connection opened possibly all day. I'm looking into incorporating Datasets, dataAdapters into my next phase of evolution. I looked at the material and it's tough. For me anyway. But I will get into it. I will fetch the data into a dataset so that I can keep the connection open only for a little while. I was turned on to this "keep the connection just as long as you need it" idea from someth

View 3 Replies

Create Connections Through Proxies?

Jun 25, 2010

I am making a web browser and I was wondering how I could create connections through proxies. Right now the browser only uses UDP packets, so any info specifically on that would be great.

View 8 Replies

DB/Reporting :: Different Types Of Connections In .Net 08 ?

Aug 28, 2009

The current project that I'm working on is mainly employing a database back-end, and I have a few questions regarding database connections in .Net, before I actually convert.

For VB6, I connect to my databases using ADODB connections and recordsets in code only, and not by binding controls. I perform my queries using SQL statements..For differentations in the type of database, such as connecting to a MySql, a MsSql, or an access database, it was mainly the connection string that had to be changed.. and ofcourse installing the drivers.

Now for VB.Net, I believe this can be done using the System.Data assembly. While looking into it, I've seen that it has a lot of members, such as System.Data.Odbc, System.Data.OleDb, System.Data.SqlClient.

My question is, what is the main difference between those namespaces (just briefly)? I would like to generally understand the main differences before I start with anything. I have also heard about LINQ. It looked very alien to me in the MSDN library. (PS: what's the deal with Ado.Net?)

View 6 Replies

Finding Available Wireless And Lan Connections?

Oct 14, 2010

i'm using Visual Basic 2008 - Office 2007 - addin for ppt.

ok i'm going to delete the other thread. i'm going to rephrase and try to explain as clearly as possible.

I need to find a code that (when i click the "Search" Button) will start searching for all available lan and wireless connections.

All the available selections will be shown in a List Box provided.

Once i find one i want to use, i can stop the search (by pressing another button "Stop" in this case) or just straight away click the one i want and press another button ("Select" in this case) and if it needs a password or WEP then it will display or it will just connect without asking.

View 10 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved