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


ADVERTISEMENT

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

Why Does Vb Not Detect A Disconnected Socket

Apr 10, 2010

I am using the following code to receive data in a seprate thread

[code]...

Now if my client shuts down elegantly then my application knows that the client has disconnected but if my client is removed from the network or any other issue occurs them my application does not appear o know that the client disconnected why is this ??

View 4 Replies

.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

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

VS 2005 StackOverflowException In Socket Client?

Apr 6, 2010

I'm working on a simple socket client application that transfers files from one PC to another. The flow is as follows.

Client sends message to Server
Client Listens for response
Server responds with command
Client sends file or message to Server
Client Listens for response

This sequence will repeat thousands if not tens of thousands of times. It runs great on my dev box but when I load it on another machine I get a StackOverFlowException. I know why I'm getting the stack overflow. It's because I have a Listen subroutine that calls a Send routine. When the Send routine is done it calls the Listen routine again. The process works for about 614 iterations and then bombs out with a stack overflow. I guess my question is, how can I code a socket application that can send-->listen-->send-->listen thousands of times without blowing the stack?

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

Implement TCP KeepAlive In Program On A TCP Client(socket)?

Apr 24, 2012

I want to implement the TCP KeepAlive in order to check dropped connections by running a timer.

In my case, I have a TCP Client (using socket class) and a third party server (i have no control on it).

How can i use the TCP KeepAlive on my TCP Client in order to check the connection state?[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

Threading Windows Service TCP Socket Client?

Jan 22, 2012

I'm trying to build a multithreaded SMPP client with VS2008 and I'm getting bogged down in threading. Basically my main parent thread will interact with the windows service scheduler, get registry settings, and get a list of SMPP servers to connect to. Then it will launch a thread for each SMPP connection, which will need to keep it's TCP socket open to receive messages with, so the thread must remain running even if there aren't any events happening (no messages to receive)... but I can't seem to get it figured out.

[Code]...

The Start sub in the oChannel object does run, but once that sub is finished running the thread ends. In the Start sub, it calls other code that initiates a connection to the remote SMPP server, but that code asynchronously waits for an event to be raised regarding the connection status. Once the sub finishes, the async connection being attempted doesn't seem to be able to pin the thread down.

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

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

.net - Socket.AsyncSend Behavior When Remote Client Stops Receiving

Mar 6, 2011

I'm running into an issue where I have a lot of AsyncSends going on with dozens of client sockets, and at the moment if any remote client stops receiving but doesn't actually disconnect, the app quickly eat sup all of the SocketAsyncEventArgs (aka an sae) I have preallocated because they're not released since the SendAsync is not completing. The obvious solution to this is to implement a per-client send queue, which sounds easy enough but I am unclear as to the specifics. I have one sae allocated per client to receive, which works perfect, and ideally I'd love to allocate a single sae to the client's async sends.

I understand popping in and asking a question that is veiled request for a 'give me code' solution is looked down upon, but I honestly have not been able to turn up a lot, either on the .XAsync methods, which Microsoft has a horribly poor example for, nor for a send queue in general.

Edit for @J.N.

I forgot to mention it, but I -am- actually using a bunch of preallocated sae's stored in a managing class that internally uses a ConcurrentBag. With one connection, in a test scenario where 20 small messages are sent per second (this is slightly more than double how many messages would actually be sent in the production server), the server eats up 500 preallocated sae's in a few seconds. If I implement 'create if empty' code, the sae count quickly climbs into the thousands.

I understand the functionality that the async methods of the Socket class provides, but if there's a network hiccup or something similar, this issue will outright bomb the server within seconds. A send queue sounds like an great solution, but I have no idea whether it's a good idea to do in a high performance production environment or not.

The base problem remains, though, that with a dozen messages per second per client being sent out, any network congestion or other factor that lags the connection but does not disconnect it will quickly deteriorate into a laggy mess.

I think a solution I might be looking for is something that locks up the single sae being used for sending until the completion callback is reached, where that sae is then unlocked and then reused to send any pending data. The actual implementation of it eludes me though.

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

Communications :: Socket Behaviour - Created A Client That Can Send And Receive Data Via TCP Sockets

Aug 26, 2010

I have created a Client that can send and receive data via TCP sockets. The objects stored on the serverside are the *exact* same object used for the client. They use the same send and receive protocols.

Now, when i send a string from the server to the client , it does precisely what it should do. However when I send a string to the server.... I do receive the string as an equal length of NULL characters. I run the server and client locally.

Basicly what can influence the behaviour between two completely identical objects performing the exact same task? I wonder if there is some socketflag issue if the TCPlistener.accept function returns a completely different setup then the one I R used to.

(if it is of any interest, the send protocol is asynchronious)

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

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

Chat Client Disconnect Button And Username Check

Aug 24, 2010

I am working on a code for a chat client/server and I have it all working, I can connect and chat locally and global. The problem I am having is that when someone just hits the X in the corner to exit it crashes my server as well as the fact that if someone wants to they can make their username the same as someone elses.

[Code]...

View 5 Replies

Game Programming :: Check What Windows The Client Has On His Pc ... Xp / Windows7 / Vista?

Jun 9, 2010

how can i check what windows the client has on his pc...xp/windows7/vista

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

Disconnected And Connected Feature Of ADO.NET

May 19, 2010

I just read a book : Pro ADO.NET 2.0.It discuss about the disconnected and connected feature of the ADO.NET.In disconnected, the "data container" is DataSet.But it doesn't say anything about the data container if i use the connected feature. In ADO, we have recordset, what about ADO.NET.

View 3 Replies

Go Last And Go First Code With The Disconnected Mode?

Jul 6, 2011

in the begining i cold the database (accdb 2007) (AGC)and the table(telp)

in form declaration
Dim cn As New OleDb.OleDbConnection Dim cmd As New OleDb.OleDbCommand Dim ad As New OleDb.OleDbDataAdapter Dim cmdb As New OleDbCommandBuilder Dim dbs As New DataSet

[code].....

View 2 Replies

Handle When COM Object Is Disconnected From RCW?

Feb 15, 2012

Is there any way to run code when COM object is about to be disconnected from RCW without implementing IDisposale interface and explicit call MyObject.Dispose in client code?

The code below is not working. When program enters Finalize sub, ExcelApplication is already disconnected from RCW, and I get error. I understand why it happens, but I want to get a solution.

I want to make it working the following way: when last managed reference is released, code from Finalize sub is executed before COM object is disconnected.

My question is - is it possible at all and if it is then how can I handle this event inside the class, without need to call Finalize explicitly from outside?

Very simple class:

Public Class ExcelRunner
Dim ExcelApplication As Excel.Application
Public Sub New()

[Code]....

View 1 Replies

VS 2005 : What Is A Disconnected Architecture In Dot Net

Dec 25, 2009

what is a disconnected architecture in dot net?Why are the dataSets a disconnected architectures in dot net?

View 15 Replies

VS 2010 - Client Write It’s Data In Textboxes Or Comboboxes Or Check Any Checkboxes

Oct 16, 2011

I need to write client / server application... I need that client write it`s data in textboxes or comboboxes or check any checkboxes and etc. but I need that this info saved not in it`s own computer,on server...

View 5 Replies

Network Connections Disconnected After Launching .NET App?

Feb 17, 2011

I shipped a VB .NET app to my customer. They installed the app in program files folder. The app starts and everything works ok. Now my customer reports that some intranet TCP/IP connections are interrupted after starting the app. Sometimes they are not available after starting my app, sometimes the intranet connections are still available after my app has been started. After my app has been started, there are connection error messages to their intranet services. After re-starting the machine, they still can't connect to the intranet services. A fix is to login with another user name or re-load the profile from the server after they have been logged in on another machine.

Do you have any ideas where to start further investigations? Is it possible that my .NET app interrupts or blocks intranet connections? Could you recommend any trace tool that gives me a hint when and why the intranet connections are blocked? Why could it work for them after they login on another machine?I am wondering if my .NET app could disable the intranet connections. Do you have any recommendation for testing that?

View 5 Replies

Trap A Connection String That Is Disconnected?

Sep 11, 2009

How do i trap a connection string that is disconnected?

View 5 Replies

Accessing SQL Server Database In Disconnected Mode Of ADO.Net?

Sep 3, 2009

code to access SQL Server database in connected and disconnected mode through ADO .Net.

View 4 Replies







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