Error When Working With Socket TCP IP

Jan 12, 2011

this is the first time I try to study the socket of .NET. I configed follow the tutorial here [URL] . Then I try to write some execute code for my project. I insert an "Add item" to a listbox after socket server receiving Data from client. However, the server doesn't execute my "Add item" code and it disconnect to the client? If I erase this code, everything is ok!

[Code]...

View 6 Replies


ADVERTISEMENT

Communications :: Socket Connection Error

Aug 1, 2008

I'm working on an application that communicates to torque controllers on the factor floor. The user inputs an IP address and a port and clicks the btnConnect button to make the initial connection. Once that completes a KeepAlive message must be sent periodically to maintain communication with the torque controller. The initial connection works very well but a socket error (see below) grinds everything to a halt when the KeepAlive message is sent. I would appreiciate any ideas the readers may have on the root cause. I'm quite confused because basically the same code is use for both the initial connection and then the KeepAlive messages. I have pasted some of the code as well below.

[code]...

View 1 Replies

Windows Socket Error (VB 2008)?

Jan 25, 2011

My code works fine under xp pro but not under windows 7 ?System.Net.Sockets.SocketException = {"The system detected an invalid pointer address in attempting to use a pointer argument in a call"}

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

Socket Error 'A Blocking Operation Was Interrupted By A Call To WS?

Mar 23, 2011

making an sort server/client app and i can start the server and such... , but when i trie to stop the server i got this error:

A blocking operation was interrupted by a call to WSACancelBlockingCall
This is the code where i get the error:
Public Sub StartServer()

[code]....

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

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

Error Is "socket.exception" / Number Of Server's CRASH In On Day More Than 10 Time ?

May 26, 2009

i'm using socket programming in vb.net 2005 and make a Server/Client windows application and it used in the network to multi user chat server and havent error and it work , but one BUG in server app : the Server app. work currently until the number of clients more than 30 and then it crashed . and error is "socket.exception" . now tell me what to do ??? it's very very important to me because the number of server's CRASH in on day more than 10 time and i end it and then run again and it's not good for my job .

View 5 Replies

Socket Error "The Requested Address Is Not Valid In Its Context"

Dec 23, 2009

"The requested address is not valid in its context."

[Code]...

View 2 Replies

C# - How To Fix Error "Only One Usage Of Each Socket Address Is Normally Permitted"

Jan 23, 2012

I have 1 process that acts as a server (TcpListener) and one or more processes that act as clients (TcpClient). The clients are sending Tcp requests to the server every 1-2 seconds to which the server responds with a result message.

In normal conditions the server will use TcpListener.Stop when it closes, but sometimes the server will crash (for whatever reason) and then this is not done. If I then try to restart then I get the following error:

"Only one usage of each socket address (protocol/network address/port) is normally permitted"

I only get this error when there are clients running who keep trying to connect despite the TcpListener is not there anymore (crashed).I don't get this error when I first manually close/kill all clients before restarting the server/TcpListener.I'm looking for an automatic recovery procedure that deals with this error/problem. How can this be done?Below you'll find code examples of the server and the client.BTW: Although the codes examples are in VB.NET, I can also handle C# code. That's why I tagged this question with both VB and C#.Code example for server/TcpListener:

Public Shared Sub Thread_TcpListener_GUI()
While True
Dim tcpClient As TcpClient = Nothing
Dim tcpListener As TcpListener = Nothing

[code]....

View 1 Replies

Error Checker Is Not Working

Mar 8, 2012

Private Sub CommandButton1_Click()

If TextBox1.Value = "" Then GoTo First
Dim new_sheet_name
Let new_sheet_name = TextBox1.Value
On Error GoTo ErrorHandler:

[Code]...

View 3 Replies

Application Has Stopped Working Error

Oct 29, 2009

I keep getting an error that says hte application has stopped working and Windows is searching for a solution. When I click to debug, it tries to start a new instance of VB, but then tells me that a debugger is already running. Why is this happening?

The error is a uncaught Win32 exception and occurs somewhere inside a thread that I create, but I have no idea where.

View 3 Replies

Getting Error While Working With Datasets In Sql Server

Jun 4, 2009

In mt project im calling data from sql server to display in labels. Howerver when there is no data for a paticular customer im getting an error saying "There is no row at position 0." How can I set the row so that it doesn throw an error but just returns a blank lbl?

View 5 Replies

.net - SQL IErrorInfo.GetDescription Error.Brackets Not Working

Feb 24, 2010

I have the following code. I tried putting brackets around all the tables and parameters with no luck. The query works in Access though.

Dim cn As OleDbConnection
Dim cmd As OleDbCommand
Dim str As String

[Code].....

View 1 Replies

Error Log File Location Not Working On Vista With UAC?

Oct 13, 2009

I have a program that writes unhandled exception detail to a log file stored in the same directory as the program itself. I am wondering how I can have keep the file in the same location, and not have to worry about a file write access. With Vistas User Access Control enabled, the file is not accessible unless the program is run as an administrator, which I don't need it to be for anything else. The file does not exist all of the time, it only exists after an error occurs. Users are encouraged to email the file to me and then delete the file. Thus the file should only exist if their is a error that the user has not emailed. I really want to keep it in the same directory as the program itself, or within a subdirectory of the programs directory, since the portable version is exactly the same program executable and I would like to keep it that way. I am not sure how to go about setting the file security, set it when I create the file if the file doesn't exist, prompting for Administrator privileges to create it with the security. I was also thinking that I could just set the entire folder containing the program executable when it is installed, and then it would be able to create the file without having to have administrator privileges.

View 1 Replies

Launching Deployed App Error: Stopped Working

Apr 5, 2010

I deployed a VB.Net app and ran it and I get 'AppName has stopped working" "Windows is checking for a solution to the problem" along with a Cancel button under Windows 7. Under XP I am only getting the option to Send the error report to Microsoft or not. There is no apparent way to hook into a debugger. I am not getting any exception data. I have put msgboxes at the very start of my code and they are not hit so it is failing before any of my code is even executing. I have checked all dependencies that I can think of. I developed the app on VS2008 Windows 7 and deploying to Windows 7 and WinXP. I need some advice - how do I debug this?

View 2 Replies

MySQL 'UPDATE' Not Working Nor Outputting Error?

Sep 17, 2010

I have made this code, which is to update the MySQL db, the only problem is that even though i got try on, it dosnt catch any erorrs, and the code is not working, meaning it dosn't update anything in the db.

code:
Private Sub updateSqlData()
Dim nSQL As String

[code]......

View 10 Replies

DB/Reporting :: Error In Inserting - Not Working But Correct Statement

Dec 17, 2008

I keep getting the following error when inserting in to my Access DB using VB.

THe code I use is:

Code:
Dim code As String = "INSERT INTO tblUser(Username, Password, Forename, Surname) VALUES('" + txtrEmail.Text.Trim + "','" + "dfd" + "','" + txtrForename.Value.Trim + "','" + txtrSurname.Value.Trim + "');"

[Code].....

I got the sql code to write in a text box and executed i manually in to Access DB and it works perfectly.

View 12 Replies

Error Compiling Code For Working With A Comm Port

Apr 8, 2010

I did a search for "How do I implement Serial COM Port communications? and found a response by Xiaoyun Li which was last posted on April 10, 2009. Xiaoyun's response included sample code. My intent has been to get a clean compile on the sample code, then test it, then expand the code into a real application. I am down to a single error message, which I can't figure out how to resolve: "Method 'Public Sub DoUpdate()' does not have a signature compatible with delegate 'Delegate Sub EventHandler(sender As Object, e As System.EventArgs)'." [code]I marked where the error occurs in the code with *** to the right of the error line.The code is attached to a simple form, Form1 which contains a single text box, TextBox1.It appears to me that the code needs a Delegate statement, but I can't figure out how to code it or where to put it.d.

View 3 Replies

Error Visual Studio 10 Stop Working And Restart?

May 13, 2011

ften Restart. I have install SP1 version and full Key. but i dont know that ?

View 3 Replies

IDE :: Debugging Error; Vshost.exe Not Working ; File Not Found?

Sep 19, 2011

I am unable to debug any projects as of a Windows Update 2 days ago. It not only caused problems with VS 2008 but also SQL Server 2008. I did a system restore and my SQL Server is back to normal, but VS 2008 will not debug any projects. I get a vshost.exe has stopped working and then a file exception error. I am copying the file exception msg:System.IO.FileNotFoundException was unhandled

Message="Could not load file or assembly 'sortkey.nlp' or one of its dependencies. The system cannot find the file specified."

[Code]...

I have tried repairing VS 2008 and also a SFC scanow from the cmd prompt. I have also tried unchecking the vshosting property. Nothing works

View 2 Replies

Update Query Not Working For Access And Not Showing Any Error

Jul 30, 2009

this is the code

Dim con As New OleDb.OleDbConnection
Dim com2 As New OleDbCommand
Dim constring As String = ConfigurationManager.ConnectionStrings("esourcecon").ConnectionString
con = New OleDbConnection(constring)
com2 = New OleDbCommand("UPDATE Customer SET CName = @CName, CAdd= @CAdd, CTel= @CTel, Cmob= @CMob WHERE CName='" & C1.Text & "' ", con)

[Code]...

id is an autonumber field and if i change the where string to another column then also i dont get any error and the values are still not entered

View 9 Replies

'Option Strict On Disallows Late Binding' Error When Working With Excel Files

Aug 6, 2009

I am using VB 2008 and office 2007. Option Strict On it gave the error in the flowing statemens:[code]

View 6 Replies

ProxyReader.EndOfStream Keeps Giving Error In App (included .vb File, It's Working Alone On Fresh Project)?

Apr 20, 2012

Alone form proxy.vb is working without problem, but when I copy it and include to my project I getting always:

Exception:Thrown: "Index and count must refer to a location within the buffer." (System.ArgumentOutOfRangeException)

[code].....

View 3 Replies

Sockets - Winsock Not Working And Getting "Please Check It And Try Again" Error?

Jan 29, 2011

i am trying to get this code that worked in VB6 just fine to work in VB.net 2008. It doesnt seem to want to connect (but has no error after it goes past the sockMain.Connect().

[code]...

I get the It doesnt seem that the server is running. Please check it and try again. error.

View 3 Replies

How To Fix "Stopped Working" Error Message

Nov 23, 2010

I am currently working on my WebBrowser, and when I make a copy of the shortcut to my desktop, and I open it, and says "Voyage has stopped working." (Voyage is the name of my browser)So, I am using MdiTabControl and GeckoFX in my browser. Do you think that is causing it? If so, how can I fix it? I know of WebBrowsers that use Gecko and MdiTabControl, that do not have this problem.

View 2 Replies

UnhandledExceptionEventHandler Samples From Msdn Working, In My Code Not Working?

Sep 3, 2009

I found on msdn samples and modified (add Thread.GetDomaind.UnhandledException)

<SecurityPermission(SecurityAction.Demand, Flags:=SecurityPermissionFlag.ControlAppDomain)> _
Public Sub Main()
' Add the event handler for handling UI thread exceptions to the event.[code].....

View 1 Replies

C# - Set Up A Web Socket Connection In .NET

Jun 22, 2011

I have my index.aspx file:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="index.aspx.vb" Inherits="Web_Socket.index" %>
<!DOCTYPE html>
<html>

[Code]....

so now my question is how do i connect the WebSocketServer.cs to the index.aspx ?

As a start, all I'm trying to accomplish is just to get the Web Sockets working, and have the connection established, which then will alert("Stock Ticker Connection open ...");

View 1 Replies

Keep A Socket Declared?

Apr 9, 2011

how do I keep a Socket declared forever so i can call it in other methods?

All the tutorials i've read just have a server, client, server sends client message, client disconnects. What if I want to remain connected? I've tried making the sockets global but that didn't work somehow.

View 1 Replies

Re-use Socket (UDP) With Another Port?

Apr 17, 2008

I have a socket which I use to monitor data on a specific UPD port (Let's say 1200).[code]...

View 3 Replies







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