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
ADVERTISEMENT
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
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
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
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
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
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
Mar 16, 2010
How can I create a socket created with programming
View 1 Replies
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
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
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
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
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
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
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
Dec 24, 2010
My text file is a settings file and I know I will be adding more to it in the future, right now it reads "autoplay=false;mintray=false;"I am currently using probably the most inefficient way to check both of those settings:
if contents = "autoplay=false;mintray=false;" then
elseif contents = "autoplay=false;mintray=true;" then
elseif contents = "autoplay=true;mintray=false;" true
elseif contents = "autoplay=true;mintray=true;"
endif
How can I read the file, find each word from the equals sign to the semicolon, and store each of them in a variable identified by the text before the equals sign? Something like this:
contents = "autoplay=false;mintray=false;"
autoplay = "false"
mintray = "false"
Also, how can I edit the settings in the text file without having to overwrite everything every time I save to it? For instance; finding mintray in the text file, and changing mintray to true instead of overwriting the file with "autoplay=false;mintray=true;".
This is my current
Reading
Dim fs As New FileStream("C:myfile.txt", FileMode.Open, FileAccess.Read)
Dim d As New StreamReader(fs)
[code]....
View 3 Replies
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
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
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
Jul 22, 2012
I am doing client/server socket based project and currently I am having some troubles with the recieved result.What I mean ... this is part of the client which is receiving
tcpClient.Connect(address, Port)
Dim
bytes(tcpClient.ReceiveBufferSize) As
Byte
[code]....
Where file is just a simple file name send from the server. What I recieve is for example: test.txt%00%00%00%00%00%00%00%00 etc. The server and the client are using the same encoding ASCII.
View 1 Replies
Jun 2, 2010
I have a device which send me data over a particular port. The data is in XML Format.
Now I already did a small console application which listen for the data and print out the data on the screen.
Now my plans are to deserialize the xml data or I will create the insert statement into the database.
1) The device send me the data every second (if there is data to send me).
2) I cannot say how much data the device is going to send me.
How can I make sure to capture all data without loose any information..
View 2 Replies
Sep 18, 2009
Is there a way to determine if a System.Net.Sockets.Socket has sent data that has not been received/read by a specified remote endpoint with a connectionless protocol?It never hurts to try.
View 1 Replies
Jun 23, 2011
I'm having an unusual problem that I've never had with WR's before. I have a very user-driven program that interacts with a server of mine through webrequests. Depending on what the user's doing, it could end up sending a dozen requests/minute. This has never been a problem before, but for some reason system memory usage increases and doesn't stop increasing, as if something is cluttering it up for every webrequest that is sent out.
Is there a known problem with WR's like this? Or is it just a random screw up? I can get my system back up and running smoothly.
View 5 Replies
May 11, 2009
[code] The problem in my case, this is not working with this code. All I need are random numbers outside the above boundaries.Please note when I remove 'Not' in 'Loop While' statement, the programme runs indefinitely!!
View 11 Replies
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
May 25, 2010
I want to read a random line (that I've chosen via random number) in a text file. I want to the system IO reader. But I am confused as to how to read a random line. Here's what I have...
[Code]...
View 10 Replies
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
Sep 7, 2010
I have one excel sheet which has ontime event of 5 mins to run some code.This code works fine when in debugging mode. But if I lock my PC or minimize excel windows and start working something else, this code just pauses at beginning and as soon as I activate excel window, this code runs.this code involves opening and closing of one userform and i think userform is culprit.
View 2 Replies
Jan 28, 2012
I have recently taken a liking to programming, and have programmed a few games in C#,my friend has asked me to program an application for him to use in his shop. But I have no idea of what language is best suitable?
View 8 Replies
Jun 4, 2010
what's the vb.Net counterpart of the following blocks in Csharp?
[Code]...
View 4 Replies