.net - Check The Connection State Of A TCP Server (Socket) With TCP Client?

Apr 23, 2012

For almost a week I am reading and trying to find a solution for checking connection state using a TCP Client (using socket class) In my scenario I have a TCP Client that is connected to a server (it is not controlled by me) and i want that from time to time to check the connection state, and reconnect if necessary.I have read a lot of information on the internet but i did not find a suitable solution.Briefly, these are the methods that i have found on the internet and try to implement.But unfortunatelly, i have found some scenarios where the TCP Server is closed and the TCP Client is still saying Connected 1.Example from MSDN

[code]...

View 1 Replies


ADVERTISEMENT

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

Get The Client Connection Parameters Of The Socket On Server Side?

Sep 13, 2011

I want both the client and server to write and read resp. at a constant rate (which can be configured on the GUI of the client) to the buffer.I am able to send from the client at 150 bytes per packet Now, I should be able to read also at 150 bytes per packet on the server too Since, both are connected through a socket, can we retrieve the socket params (set on the client size, like 150 here) from the server end, using the tcpServer object.Or is it must to send an initial setup packet which tells about these client params and so accordingly the server can continue?

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

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

Info: Multithreaded Server Socket Program Or Client/Server?

Oct 26, 2011

I made a simple TCP server (I've found the example on the web) in VB to receive data from about 40 TCP clients.The clients are not synchronized but sends data about every 18 minutes; the problem is sometimes several clients sends data at the same moment, so I can't receive data.I also made a second program that reads the data (server program writes data on a file, read from the second program) scheduled.

My question is this: I've seen on the web examples about Multithreaded Server Socket Program, so I suppose this could manage my 40 clients (but now the clients are syncronized and send data at the same time in client mode) or is better get data (I have a central client that asks data to all 40 devices in server mode)?

Second question: can I make a single program where I run both TCP client and TCP server at the same time?

View 1 Replies

How To Check If Client Socket Has Disconnected

Apr 13, 2009

i am using the client/server classes for file transfer by moeur.what i want to know is that once my client is connected to the server and after that the client machine goes off the network. now when my server trys to send a file or some message to the client i am not able to trap the error that the client is disconnected.how to do this. there might be a case where the client machine suddenly shuts down. in such cases how will my server know that the client has disconnected.

View 2 Replies

Client Server Winsock Or Socket Programming?

Jul 14, 2009

how to access client side activity i.e. which client is connected and which computer connected at the same time from server.

View 1 Replies

TCP Client Error While Reading Data From Socket Server?

Apr 20, 2012

I have a TCP Socket Client (using the Socket Class) that is connected to a simple TCP socket server (just for testing)I have this code snippet :

Dim aSocket as Socket
While aSocket.Connected = True
byteRead = aSocket.Receive(dataByte) 'number of bytes

[code].....

View 1 Replies

VS 2008 Chat Server/client - After The Client Clicks Disconnect Or Closes By Task Manager, Looses Connection

Aug 18, 2009

Im using the code from [URL] as a starter, most of the code is the same. the chat system works fine but on the client a added a disconnect button "clientSocket.Close()" and as soon as i click that i get errors, on the client, this is the code...

Private Sub getMessage()
For infiniteCounter = 1 To 2

[CODE]...

And this line...

serverStream.Read(inStream, 0, buffSize)
gives me "Unable to read data from the transport connection: A blocking operation was interrupted by a call to WSACancelBlockingCall."

Now im talking the server, after the client clicks disconnect or closes by task manager, looses connection, etc the server crashes and gives me.

View 5 Replies

Specific Cast Is Not Valid In Client Server Socket Program

Jun 14, 2012

I am Working on Teghax Component.Using This Component we want to find out Block title attribute of dwg file in a client server socket application.

1> We get Block title attributes properly of dwg file in windows application form using the getattribute function().

2> We get Block title Attributes properly in that way:-We take a class library where we take a class.in this class we use getattribute function().Then We access the particular class from another project

But when we use the same class(Keep same structure) in client server socket program.Then it gives an exception.i.e ,"Spaicfied cast is not valid"I am Not getting any reply form teghax developer..I attached exception screen sort.Give me Suggestion How to solve this Exception

Code given Bellow :

Public Function Get_DwgFileAttribute(ByVal Sender As ClsTcpConnection, ByVal msgTag As Byte, ByVal message As String) As String
Dictionary = GetHashtable(message)
Dim varfilepath As String = CStr(Dictionary.Item("filePath"))

[code]....

View 1 Replies

VS 2010 TCP Chat Server Closes Socket On Client DisConnect?

Jun 24, 2010

I am working on a chat client and server, and so far it works well, but when I close the client, the server throws an exception because it continues to try to do processes on the disconnected client. I have tried adding clientSocket.Close() in various places throughout the client and server with no luck. Does someone know how to add the disconnect code to either the server or client with this code?Server:

Imports System.Net.Sockets
Imports System.Text
Module Module1

[code].....

View 5 Replies

Asynchronous Socket Programming Vb 2008(.net) Again Server Should Able To Send The Data To Client

Feb 2, 2011

I am facing problem in asynchronous socket communication.

1)I wanted to perform connect(from client to server) operation on enter button and send the data whatever client want to send and disconnect from server. And again client should get connect to server whenever client wanted to send data. this is the mechanism.

i.e how to reuse the socket.

2)Again Server should able to send the data to client.

View 5 Replies

Socket Programming - Close A Connection From Server?

Nov 24, 2011

I have the following code in my Server Form:

Imports System.Net, System.Net.Sockets
Public Class ServerForm
Private serverSocket As Socket
Private clientSocket As Socket

[code]....

for the first time, when I click on Connect, it is going to connect to server as well and also it works if you click on the disconnect. for the second time if you click on the Connect button, it gets connected but the disconnect button is not working.

View 9 Replies

The SMTP Server Requires A Secure Connection Or The Client Was Not Authenticated. The Server Response Was 5.5.1 Authentication Required

Nov 28, 2009

This emailing code wont seem to work in my program. I get an exception "The SMTP server requires a secure connection or the client was not authenticated. The server response was 5.5.1 authentication required."

Imports System.Net.Mail
Public Class emailStudent
Private Sub sendEmailButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles sendEmailButton.Click
SendMail()

[code]....

View 12 Replies

Connection's Current State Is Closed - Connect To Sql Server And Display A Record

Jun 21, 2010

I am a ASP Classic Programmer, professionally for a little over a year, I have developed some rather nice sites, including the one in my signature (Still a work in progress).

I have been forced to use ASP.NET (VB) for a FileUpload control, as it offers a self controlled way of creating Thumbnails, without the use of 3rd party controls, which is great, as my hosting server does not allow for 3rd party installs on their servers.
So.

The code below is what I have so far for connecting to the database and displaying a record is the "cookie" exist on the users computer.

Unfortunantly, this is not working, and to be honest with you, their is not a whole lot of resources available to show how to do this correctly.

So I am stuck with a lot of post and hoping that someone can actually assist me with this and tell me what I am doing wrong and maybe correct my code.

I am getting an error about the "Connection is closed"

If you want to re-write my code, I prefer something simple and basic, as the only thing that I am doing to checking rather the user is logged in, and if so, display a record from the database. I am NOT in the need for the DataGrid, so please do not suggest it, as I am only needing to check this one thing.

I would like to also add, that I have successfully contect to my database with the FileUpload control and save file names of the images uploaded, so I know that my connection string is done properly> But, for some reason the "SELECT" statement is causing a HUGE issue. (It was easier to insert, than to select, I am not use to that)

CODE:

View 4 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

Connect VB Client Application With SQL Server Using TCP Connection (LAN)?

Feb 15, 2012

I've been Searching the Net for hours now, and i can't really seem to find anything clear and straight to the point.

I need to create a Server/Client application using VB.net 2008, it's actually my first time to have a database on another computer. So I first searched the internet for the things i need to make this software.

[code]...

View 5 Replies

Connection String For Client-server Application?

May 5, 2012

I want to create a client-server application, it means I just need 1 database on the server.I have a computer and a laptop. I set my laptop's IP to 192.168.1.1 and my computer's IP to 192.168.1.2.Now I place the database on my computer, the database name is db_transportasi.Problem is, how to connect my computer's database from my laptopSpecification :I'm using this string below for my connection :Data Source=ARVID-THEODORUSSQLEXPRESS;Initial Catalog=DB_TRANSPORTASI;Integrated Security=TrueI already setup my SQL Configuration Manager, enabled the TCP/IP, switch to the IP Addresses tab and set the IPAII Port Properties to 2301I turned off my firewall so I don't have to set any exceptionQuestion

View 4 Replies

Setting Up Client/server Connection!THesis?

Mar 11, 2010

I am a newbie in VB.NET I am using Sql Server Express 2005 as my database.I am currently working with my THESIS. A Human Reources Information System that concerns only with the file and record management of the employees. With two modules.a. Administrator for HR Manager (w/ installed vb.net and sqlserver express 2005)b. Staff for HR Clerk(w/ intalled vb.net)

Here is my problems:

1. I want to learn how to connect my vb.net application in each other using TCP/IP or any network connection tips.Scenario: If the client Save/Edit/Delete/ a record automatically it will saves on the admin sql database.

[Code]...

View 2 Replies

TCP Connection Code For Client And Server Communication?

Nov 5, 2011

I have a TCP connection code for client and server communication. It's not meant to be malware but it collects the clients computer information and then connects to the server.

It successfully "connects" but then immediately disconnects.Here is the code for the server:

Dim Listener As TcpListener
Dim Client As TcpClient
Dim ClientList As New List(Of ChatClient)
Dim sReader As StreamReader

[Code]...

I have port forwarding all done and it works if I run the client and server on my own machine. If I run the client on another machine though It gives me a message box saying that it connected with the clients remote IP and at the same time it tells me it disconnected. The client never sends the system information. What is the problem?

View 2 Replies

C# - Push Website From Server To Client Using Wifi Connection?

Jan 29, 2011

I want to make an application that can push ads (website) to client..

Here is the case : Client try to connect to internet via wifi. Once the client is connected, server send a website address to client, and a popup (website sent by server) will appear in the client's computer in default browser.

I can list all IP connected to server, but i don't know how to push the website to client

Here is the code to list all IP connected to server : (import System.Net library)

String strHostName = "";
if(args == null || args.Length == 0){
strHostName = Dns.GetHostName();

[Code]....

View 1 Replies

SMTP Server Requires A Secure Connection Or The Client Was Not?

Jun 18, 2012

So I'm making a Program to Start/Restart/Stop and running commands from the Console for my Server.Now when someone uses the console, I want to be alerted of it on my Mail.I am using Visual Studio 2010.

[Code]...

View 1 Replies

Using Vb Express 2005 Build A Client And Server Connection?

Aug 9, 2010

i need to know about how to build connection with server and client? eg: my server is 140.134.5.1 and my client need to connect to it to do communication,how should i do?

View 6 Replies

C# - WCF ReceiveTimeout Infinite - Keep The Client-server Connection Endless Open

Mar 6, 2012

I'm using a "wsHttpBinding" with a reliable session. I'd like to keep the client-server connection endless open. Therefore I need to set the ReceiveTimeout to "infinite". Has the "ReceiveTimeout" an other purpose (e.g. client crash detection; detecting a hanging request; etc) or can I set it to "infinite" without problems?

View 1 Replies

Error The SMTP Server Requires A Secure Connection Or The Client Was Not Authenticated

Feb 19, 2009

I am trying to get this program to send an email, but still no luck. I am getting the following error that I do not understand. I do not understand what I am doing wrong. Also, I may have an issue that the computer I am writing this code on and trying to send the message does not have ISS and is just windows XP home.

The error is below

System.Net.Mail.SmtpException was unhandled
Message="The SMTP server requires a secure connection or the client was not authenticated. The server response was: 5.7.0 Must issue a STARTTLS command first. k41sm2133530rvb.6"

[code].....

View 2 Replies

VS 2008 - Check If Client Is Connected To The Server By Starting A New Thread?

Sep 24, 2009

I need to check if my client is connected to the server by starting a new thread. So in short I need a way to know if the client is still connected to the server.

Here is my

[code]...

View 13 Replies

Check The Connection Of Server Path?

Mar 23, 2009

I want to check the connection of server path eg[ URL] whether exists or notI tried this System.IO.Directory.Exists("http://localhost/MyProject/ ")but it always return false.So does anybody know how to check it?

View 3 Replies

Check Connection To SQL Server When Application Starts?

Mar 26, 2010

<Visual Studio 2008(VB.Net) + SQL server 2005>

I have an application for HR and I am trying to give feedback to users on login window wheather it is connected network and database.

View 16 Replies

VS 2008 TCP Server / Client - Client To Send The Server 4 Numbers - Depending On The User's Choice

May 9, 2009

how to create a client/server... But I couldn't... I don't want anything fancy. Just want the client to send the server 4 numbers, depending on the user's choice; after that, the server would turn off the pc, restart it, etc. It all depends on the number received. Is there a rather "simple" way to do it? If it's not to much trouble you could use Atheist's example. (Btw I don't understand the code and, yes, I've checked on [URL])

View 9 Replies







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