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
ADVERTISEMENT
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
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
Feb 24, 2011
The following is a screenshot of the problem: What can I do?
View 3 Replies
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Feb 23, 2011
I have a chat program using System.Net.Sockets.Socket that works perfectly over LAN.My question is - will this same program work over the net with little or no modification and if so do i provide the client with the IP of my machine or of my router and use port forwardin
View 1 Replies
May 3, 2012
I want to transfer the file through socket in vb.net using Socket .
View 1 Replies
Oct 30, 2009
before you say something like "just search the forum for socket programing examples" I did and came up with things that were to complicated for me e.g multi threaded etc even a chat server that holds users names in a hash table i couldnt quite grasp so im asking if anyone can give me a few pointers maybe link me to a website that i havnt stumbled apon in my google seaches that contain infomation just about basic tcp server that recieves text strings no fancy users or anything like that.
View 2 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