Exception Handling In Socket Programming?

Feb 25, 2011

I'm having errors when I try to forcibly close a socket program. I don't know what is the right exception to use.

View 1 Replies


ADVERTISEMENT

MsWinsock - Socket Time_Wait Handling

Mar 20, 2010

I am using MSWinsock Control in VB, I am facing the problem when one of my clients got disconnected due to some physical reason like network cable unplug or power failure at the client's end. the Socket at which clients are connected at the server goes into the TIME_WAIT state this gives error. Now how can we correct this problem and also check the socket to know whether it is in time wait state or not.

View 1 Replies

Asynchronous Socket Programming?

Feb 23, 2010

i'm creating an Asynchronous socket programming in vb.net. i've utilised the code from Asynchronous client and server code frtom the following links:m a new user so could post only one link fully)When I try to connect the for more than one client the second client always waits until the first clientcompletes the call. i want the clients to accept calls at the same time

View 1 Replies

Socket Programming In .NET 2008?

Jan 25, 2008

how to do socket programming in VB. I'm using VB.NET 2008 and i'm a novice but with a reasonable understanding of programming so I want to learn by examples and understanding it in a novice/intermediate point of view. Essentially, I want to create a simple TCP or UDP client that can connect to an IP and port and retrieve the stream for parsing of content.

View 5 Replies

Socket Programming With Many Forms?

Mar 8, 2011

I've been making this project for our Major course in Networking Principles and Programming. Our project is an ATM System but with the use of Socket API. My partner and I chose VB.NET even if we're completely beginners.

We've researched about Socket programming in VB.NET, and we're glad that our Client-Server connection worked out. The problem is, our system contains many forms (Withdraw, Deposit, etc). We've researched the Google about Socket Programming in many Window Forms and unfortunately, we can't find any.

How can we be able to maintain the connection with many forms? Or do we have to create a new connection on every form? Is it better to create only ONE form for the client application perhaps?

View 8 Replies

VS 2008 Socket Programming?

May 4, 2010

i'm currently using my computer as host and client.. i ran the program and the console application for the server started.. but how will i be able to run the form application for the client? can VS run 2 programs at the same time?

View 6 Replies

C# - Connection In Win7 Using Socket Programming

Jan 2, 2012

I am using socket programming in vb.net to create a server client remoting application. The problem occurs when I use both the client and server in a win 7 box. It works fine for win xp or cross-platform communication (e.g. win xp to win 7). Below are the codes used at the client and server end:

[Code]...

View 2 Replies

Create A Socket Created With Programming?

Mar 16, 2010

How can I create a socket created with programming

View 1 Replies

More Than One Data Transaction Using Socket Programming

Oct 28, 2009

am developing an application where a client send data to server (socket Programing) and the server recevices it and shows it to the user through a list view but the client can send the data any time they want and it should show on the list view automatically... So i have put a timer and in tick event i have written the code like this the below code is working fine in onload event but then only once the client can send the data to the
server.

[Code]...

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

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

Socket Programming - Read Blocks Indefinitely

Feb 17, 2010

Following is the code that I'm using for reading data over a .NET socket. This piece of code is run by a single separate thread. It works OK the first time, on the second iteration it stops at "client.Receive(buffer)" and never recovers from it. Initially I was using recursion to read data but changed it to iteration thinking that recursion could be the source of problem. But apparently it is not.

[Code]...

View 1 Replies

Socket Programming - Read Blocks Indefinitely?

Feb 17, 2010

Following is the code that i'm using for reading data over a .net socket. This piece of code is run by a single separate thread. It works OK first time, on sencond iteration it stops at "client.Receive(buffer)" and never recovers from it. Initially i was using recursion to read data but changed it to iteration thinking that recursion could be the source of problem. But apparenlty it is not.

[Code]...

View 1 Replies

Socket Programming Send / Receive BitArray

Apr 18, 2011

I need to include in my application that can receive connections from a client( or two).I am thinking, that I would like to have the clients send a "TelegramID" so that I may now how to process the code.Following the "TelegramID" would be a structure that would need to be processed.So far, I can use a single client and send just plain text but need some direction for my end goals.

View 2 Replies

VS 2005 Difference Between The Socket Programming And Remoting?

Apr 9, 2010

i am a newbie in socket programming and remoting.May i know where lies the difference between the socket programming and remoting? Where do i start off to learn the basics of the socket programming?I haad a goo with the google search but unfortunately the search outcome results are a bit tough for me to understand

View 4 Replies

Communications :: [2008] Socket Programming - Receive / Send?

Mar 6, 2009

I realize this is a broad question, but how do I recieve / send packets. I know what packets I need to send and what Im going to recieve, but I dont know how to send / recieve them.

View 8 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 And Telnet Class For .NET To Simplify The Sending And Receiving Of Data?

Sep 28, 2009

I'm writing a GUI-based app in VB.net that talks to a LambdaMOO server via telnet, sends commands to display the object hierarchy, then parses the output and creates a visual representation of the object hierarchy.So my question is: is there some kind of "telnet client" class for .NET to simplify the sending and receiving of data, or do I have to write my own using the socket API?

View 7 Replies

C# - Common Programming Mistakes In .Net When Handling Exceptions?

May 21, 2010

What are some of the most common mistakes you've seen made when handling exceptions?It seems like exception handling can be one of the hardest things to learn how to do "right" in .Net. Especially considering the currently #1 ranked answer to Common programming mistakes for .NET developers to avoid? is related to exception handling.

View 14 Replies

Game Programming :: Screen Rotation Handling With Compact Framework

Oct 4, 2008

I am developing a game in compact framework. In Mobile Devices there is a button that Rotates the screen by 90 degrees so you can hold the mobile device the way that suits you. The problem is that i want to handle that in my game, so if i see that the screen has rotated the game will pause.

[Code]...

View 2 Replies

VS 2008 Socket Exception Was Unhandled

Apr 27, 2010

i got a program thats checks IP adresses and their host names by loking at the ip adress, but 1.- sometimes one ping responds but i get a socket this is the code hello = its the ip (it gets the ip from a list from a datagridview list)

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim hello As String
Dim sum As Integer

[code]....

View 11 Replies

Exception Handling Best Practices .Net?

Dec 8, 2009

I have a general question regarding best practices for exception handling. I have a class library that uses structured error handling. The functions in the library generally perform some mathematical calculations and all return a boolean value indicating whether an exception occured or not (i.e. exception occured = true, no exception = false). The actual calculated result in the function is returned as a ByRef parameter.

Anyway the input variables for my calculations are all passed to the funtions as parameters. I perform some basic checks on these inputs (e.g check that an input is not negative etc) as part of the function code. The next stage is where im unsure of the best way to do things. Using the example i just mentioned, if an input parameter is negative, I can either throw an exception such as "ArgumentOutofRange", or i can simply show a messagebox with some info about what happened. Either way i do it the function will return true. At the moment i am throwing an exception, but on reading the "Best practices for exception handling" it is recommended you dont throw an exception for things that can be checked programatically because of "performance/overhead issues".

I'm a little confused by what they mean by this. What kind of overhead are they talking about? Slower program? More disk space required? More memory required? When my functions return true, the calling methods basically drop everything and stop calculations (exit sub), so im not sure that the overhead issues they are talking about are as important to me. It seems easier and neater to throw an exception and utilize some global error strings and pass some parameters rather than copy and paste messagebox.show() all the time, and modify the text to suit the situation. Another argument for me would be that both methods of exception handling utilize a messagebox, which stops code execution until the user does something. So i cant see the issue with the performance overhead.

View 5 Replies

Handling A File Exception In .NET?

Apr 6, 2012

for the program I am creating I want the computer to check if the configuration file has been created or not. I wrote this function to do that but I don't how to handle a file exception. Here's my code currently but obviously it returns an error if the configuration file doesn't already exist. So how do I add a check for an exception?

Public Function CheckIfRunBefore()
Dim ConfDirectory As String
ConfDirectory = ""
Dim StreamReader As New IO.StreamReader("C:\VRAI\Conf.txt")

[code]....

View 3 Replies

Incorporate Some Exception Handling

Sep 29, 2009

I am currently working on my Final Project and I need to incorporate some Exception Handling. I have created one in the following code but it isn't working. I don't have any "Errors" or "Warnings" but when I run the program it says the "BadNameException was unhandled." I thought I followed the steps correctly from my book, but I am stuck somewhere. [code]

View 6 Replies

Procedures And Exception Handling?

Aug 6, 2009

I initially posted this in the wrong forum. I need help getting this to run properly. I'm trying to construct a fractions calculator. In order to complete it, I need to do it like this:Using Select Case statements, four Function procedures should be called based on the operation selected. Each Function procedure will calculate the correct operation and return the Decimal value to the calling procedure. The original procedure will print the result.

Now, the result should be calculated to the hundreths place and the input values should be validated by a Try-Catch Block.And of course, I've been having trouble with how to do this. I've attempted many times and this is what I have so far:

[Code]...

View 2 Replies

Recordset And Exception Handling

Feb 22, 2010

I have been using VB6.0 to create database-driven Apps. With VB6.0, I could Dimi recordsets to read/write data from/into database tables. I could use the read data to validate textbox controls on the Windows Forms. But I when I upgraded VB6.0 Apps to VS 2008, I had problems with PowerPacks not found, Exceptional Errors etc.Most of all the problems I have experienced are:

- Overload Resolution failed because no accessible 'item' accepts this number of arguments.
- Error Code -2146825023
- Exception Snapshot - {"Item cannot be found in the collection corresponding to the requested name or ordinal."}
- Interop Errors[code]

View 3 Replies

Resume Next In Exception Handling?

Jan 25, 2011

I have converted vb6 code to vb.net but in vb6 I used errorHandler in VB.NET we used "Tyr and catch" block

but In catch block resume next gives an error bcoz it is not valid for vb.net

[Code]...

View 1 Replies

VS 2005 With Exception Handling?

Jan 7, 2010

i did this little bit of Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

[Code]...

View 4 Replies

Check If A File Is In Use Without Exception Handling?

Apr 28, 2009

Currently to check if a file is in use (before attempting to move or send it by FTP etc) we try and open it with exclusive right and trap the System.IO.IOException that would occur if anotehr process is reading or writing the file.

However - how can we do this without the bad paractice of using an exception handler for unexceptional process flow?

View 6 Replies

Detailed Exception Handling Resources?

Jul 27, 2010

Good, detailed resources or books for best-practices on exception handling? I am looking to dive into a much deeper understanding of it, and am finding it hard. All the books I see over .NET, ASP.NET, etc. place little emphasis or detail on exception handling.

I am currently testing out a 3-tier ASP.NET application, with a presentation layer, business logic layer, and data layer, and want to know more about exactly when to throw errors, when to catch them, what layer to do them in, etc.

I don't want a simple google search on ".NET exception handling" and then having you post the first couple of links. I would like you to respond if you have quality, known resources that you have used or have found.

View 6 Replies







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