SocketAsyncEventArgs IAsyncResult Tcp Socket ServerClient?

Aug 24, 2011

First up i have been working on this for about a year now just in my free time it has come a very long way and so have I. I have built a Tcp ServerClient lib than can run in SocketAsyncEventArgs or IAsyncResult modes, i have been doing much testing of late and i have a bug if i set a thread up to spam the server with a msg every 1 ms the client read logic will drop out, the server will still get the msg's form the client so its still connected just will not read anything on the client side and this will happen in both SAEA mode or IAsync thats why i built both modes to see if i could fix it.

I have msg's showing on the client side in a Richtextbox with color and all that stuff could it be that the Rixhtextbox cant take that many msg's coming in or could it be an problem with my msg handeling but if so then whe is the server side still reading?. I use a few object pools to help with memory usage but i have turned most off to try and work this out, encrytion is off for now too only thing it is doing to a msg is serialize a msg object to a byte bufffer.Ill post some of my code:IAsync Reader its a bit messy because i have just been trying stuff but i dont get any errors(Unless i do something silly with the stream)

[Code]...

View 3 Replies


ADVERTISEMENT

C# - Implimenting IAsyncResult.AsyncState?

Sep 7, 2010

I can easily do this in C#...but I need the equivolent in VB.Net. I need to be able to implement various IAsyncResult properties in VB.Net.

View 1 Replies

VS 2008 - Extract IP Address From IAsyncResult TCP

Aug 4, 2009

How to extract the IP address before using EndAccept to accept the connection request. Its in a Layer3 of the Syn Packet on a TCP request I just dont know what Magic Is needed for Vb.net to extract that Header!

View 11 Replies

Asp.net - Updating A DataRepeater Inside Updatepanel With IAsyncResult Not Working?

Oct 14, 2010

I am having trouble binding data to data repeater when I use ISyncResult.This is what I am doing.There is a button inside a Update Panel that gets the input from the user and calls a function that returns a dataset that I then bind to data repeater which is also inside a update panel.What I did is that I made a delegate to this function, now I am calling this function like this

[Code]...

I am having hard time figuring out why the data repeater is showing no data.While debugging this I see that the dataset is getting the data and is passing the the "ds" but nothing is showing up on my page even though the data is being passed to controls inside data repeater while I am debugging.

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

Using IASyncResult To Wait For A Stored Procedure But Missing When An Error Occurs In The SP?

Jan 28, 2012

I have an application where I make calls to multiple SQL Server Stored Procedures,keep the user aware that the program is still running and how long the specific SP has been running so that they can abort it if it's taking too long.

My initial attempt was to wrap up each call to the SPs like this example:

Dim cm As SqlCommand = Nothing
Dim Conn As SqlConnection = Nothing
Dim Tran As SqlTransaction = Nothing
Dim PrevTime As Date = Nothing

[Code]...

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

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

Socket Won't Stick?

Apr 9, 2011

Then I ran into problem #1 - I wanted to call the methods in another sub but they were shared so I received the error:"Cannot refer to an instance member of a class from within a shared method without an explicit instance of a class"o, I took out shared since I didn't know how to fix it, and put in the Following as Global Variables:

Public listener As System.Net.Sockets.Socket
Public handler As System.Net.Sockets.Socket
Public client As System.Net.Sockets.Socket

[code].....

View 1 Replies

VS 2010 : How To Use Socket

Mar 22, 2012

i can connect socket well but i want to ask how can i determine that socket has received data i want to create sub or function that handles socket.receive byte the code i have is

Dim byteData(100) As Byte
Dim size As Integer = soc.Receive(byteData) 'receiving the data from socket and reading its size
For i As Integer = 0 To size
Console.Write(Convert.ToChar(byteData(i))) 'Convert.ToChar will convert the byte value into character
Next

i want to start this code each time when socket receives something?

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

C# - When To Call BeginAccept On A Socket

Nov 26, 2010

I have the following class in a Windows Service that is experiencing some vary strange shutdown behaviors. The server is shutting down from time-to-time with only this message in the event logs and no messages in the trace logs, "The Broadcaster service terminated unexpectedly. It has done this 1 time(s)."

[Code]...

View 2 Replies

Closing Socket Each Time?

May 5, 2009

In my small P2P Chat application I am listening on a port for messages and if some message arrives and pending, I am accepting it to a TcpClient and reading the data from the stream, writing back a "Received" response and closing it. This is in a loop with a sleep interval of 500 secs and runs in a separate thread. Is it a good practice to close the socket each time I receive and process a message or should I keep it alive till the chat box is closed on other side?

I am asking this because, when I do a "NETSTAT" on command line while chatting with someone, there is one entry per message that arrives locally. and many ports get to TIME_WAIT status, even if it is understood that they will be removed after 2 mins by the system.

View 3 Replies

Communications :: Socket Raw And Vista II ?

Aug 7, 2009

Using the Socket raw, with XP I can read without problems both the incoming packets and the outgoing packets. With Vista (I have tried also others Sniffers) is impossible to see the outgoing packets...WHY? what I have to do to see alse the outgoing packets? In reality I have not to read packet data or packet lenght... I need only to count the number of incoming packets and outgoing packets... but with Vista this job seems impossible... or not?

View 1 Replies

Converting Socket Written In PHP?

Sep 21, 2011

I want to access a socket that has been opened for me by my service providers. Their socket is written in PHP and I don't understand PHP at all. Themselves they don't understand VB.Net

The Code in PHP as as below

<?
$num = $_GET['num'];
$ext = $_GET['ext'];

[Code].....

View 2 Replies

Create Socket In Runtime

Nov 22, 2011

how to create tcp socket in runtime. suppose i want to create a 1 to 100 array of a socket and sending data by it how can i do it

View 1 Replies

Data Receiving With Socket?

Sep 27, 2011

i am working on 3rd party chat software, when ever i send data to server i get incorrect buffersize of data. like when i convert that data to hex to matching header for splitting data i got huge lengths data

in the above textbox of image i have got some 0000000000000000000.... with the hex data, how can i get only only original data. The code i have used to receive data is

[Code]...

View 1 Replies

Document About Socket Or Network?

Oct 18, 2009

I am into minds about how can i learn about programming soket or network.I want to you give me a website guid me about that.

View 2 Replies

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

Getting A Console Based Socket App?

Aug 3, 2009

i have made a console based socket program in vb.net, all it does 2 things:

1- server shows a msgbox when the command msg is sent from the client

2- the server opens the cd try when the command open is sent form the client

when i run it , i type the command open and works just fine , the cd tray opens , but if i type open again or msg it simply wont do anything(this also applies for the command msg, if type it a msg is shown, but if i type it agine or open , it wont respond. so its like one command per session. i tried to put the code in a while loop , but didnt work?

here is the code for the server:

Imports System.IO
Imports System.Net.Sockets
Module Module1

[code]....

View 2 Replies

How To Make Socket Chat

Jan 19, 2010

There are a series of web requests, database handling using php as well as using mysql connector. There are at most 5 timers in one window. some window has 3 or 2 timers as needed.Among some features there is a feature for chat. and I'm doing it with Remote mysql connection using mysql data connector.I'm not much familiar with VB.NET coding environment as well as with optimization issues. However made that app running with some problem, that is, when chatting, sometimes its not working smoothly sometimes stops for 4-5 secs then again responding. I'm not sure if this is happening because of timers. However a chat window has 2 timers of 1sec each.

View 2 Replies

How To Separate TCP Socket Messages

Dec 5, 2010

I've experimented a bit with async TCP socket messages between two programs, for passing data, numbers and/or text. What I've done is to use a keyword in the start of each message,and then seperate the values with the "|" character. So a message may look like this: "DATA|490|40517.9328222222|1|6|11345|11347|11344|11345|106|40517.8494212963"I set the read buffer size to 1024, as most of the messages will be within that lengthHowever sometimes I may send rapidly many short messages where several together are less than 1024 characters, and it seems then it will be read in one go. And if I send a message longer than 1024 characters, it will be split. So I'm looking for some advice on how to handle this. Should I use some special characters to start and/or end each message?

View 6 Replies

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

Send Data With Socket?

Feb 21, 2011

I want to connect with a barcode printer and sendhim some specific characters and take back anything they send to me

[code]...

View 2 Replies

Sending Array Through Socket?

Jun 8, 2010

I am doing the following :

Private Sub Button1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles Button2.Click
readData = "Conected to Chat Server ..."
msg()

[Code].....

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

Socket.Connect() With A Timeout?

Oct 16, 2009

I'm trying to use a socket to connect a TCP stream. The socket connects no problem if the endpoint has a valid IP associated to it. If I give it an invalid one, the Connect method will sit and block (I want it to) for 10-20 seconds before telling me the remote host timed out. Is there a timeout property I can set so I don't have to wait that long for the connect method? Or is there another way of doing it that does implement a timeout?

View 3 Replies







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