Socket Transmission Not Initiated By The Code?

Jun 29, 2010

I have a standard TCP socket established over WIFI with a peer.During the connection I transfer packets of data both ways.At one point in my program on the PC, the peer receives an errant read event with zero bytes and a 'close connection' command although my PC program has not issued any writes on the stream. It occurs at a similar (although not the same) point in my PC code, usually when I am making a collection, processing data and adding things to the collection. I have checked, and there is definitely no writes occurring from the PC end during this period.There is no problem with the WIFI and anyway, it always happens during the same piece of PC code, therefore it is generated on the PC by my code. I can put a checkpoint in and wait and then run the code, and then the peer will receive the errant transmission at some point during that code execution.

1. Is this normal for socket programming or is this likely to be a bug or an error?

2. Is there anything that can trigger a socket transmission without explicityly coding it?

3. Is there a way of stopping any transmission across the socket whilst not using it? i.e. a temporary hold

View 1 Replies


ADVERTISEMENT

Code For Serial Data Transmission?

Mar 2, 2010

I want to the code for serial data transmission in vb.net. and pls give full information abt how to use serial port in VB.net

View 1 Replies

RS232 End Transmission Character - Put The Word "END" In The Microcontroller Code?

Oct 30, 2011

Like the title says, i have a code written in vb.net that receives data from a PIC microcontroller via rs232, but i need a way to know when te trasmission ends. I have put the word "END" in the microcontroller code so that after he sends all the data , will send the word "END" ..so i need to implement this in my vb.net code and when "END" is received to display "finish" popup message.

Imports System
Imports System.ComponentModel
Imports System.Threading[code].......

View 2 Replies

Continuous Transmission Of A Character?

May 12, 2010

I've wrote a program that send and receives data via a serial port to a microcontroller. At present when I click (from a menu strip) a certain option I send data such as

Private Sub MsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MsToolStripMenuItem.Click
SerialPort1.Write(1)
End Sub

What I am wanting to do is instead of sending the data just once when I click this option, I want it to repeatedly send it until I select another option where the same occurs again and so on.Is there a function that acts like a while (1) loop that can do this?

View 3 Replies

UDP Based Packet Transmission ?

Jun 8, 2009

I have simple udp client and server using UdpClient class in .net frame work 2.0. My Ip address is 192.168.5.20

and client ip address is 192.168.1.25 and we client pc and mine are on same network. When i tried to send udp packet from client to server exception occurs: "A socket operation was attempted to an unreachale host 192.168.5.20:10080..." But when i change my(server) IP address to "192.168.1.20" communication is fine.How i can solve this problem or,how i can send packets other than my domains ip addresses.

View 4 Replies

Use The Code From Microsoft For An Async Socket Connection?

Mar 26, 2010

I am trying to use the code from Microsoft for an Async Socket connection. It appears the listener runs in the main thread locking the GUI. I am new at both socket connections and multi-threading all at the same time. Having a hard time getting my mind wrapped around this all at once.

[Co0de]...

View 1 Replies

C# - User-initiated Action Implementation?

Aug 17, 2010

In Flash 10 there are methods that require that they are triggered from user-initiated actions like button click, keyboard up/down keys, etc.Is it possible to implement this behaviour in .NET? For example, if we have this subroutine:

void SomeMethod() {
// Here some stuff
}

how to check inside it whether the method was called from a mouse click event handler?Also we can think of this methods like the protected functions in World of Warcraft.

EDIT: Looks like this behaviour is implemented in Silverlight — we can popup file dialogs (open, save) ONLY by mouse click or other user-initiated action, otherwise a SecurityException will be thrown. I want to achieve this bevaviour but in my case it's not a file dialog but our own methods.

View 2 Replies

Compiler Assign Value To Variable Even Before It Is Actually Initiated?

May 10, 2011

I've just read [url]...

I'm wondering if it is a typo. Do they actually really wanted to say: the implementation of the JVM is free to instead of the compiler is free to.

and my second question is that do we have this issue with C#/VB as well? (in which the ""compiler"" is free to assign a value to a variable even before the variable is fully initiated/even before the constructor function of the class of the variable is fully ran.

View 2 Replies

IDE :: Can't Display Text During Serial Transmission

Feb 10, 2010

I am using this routine to send one line of text to a serial port.The text file is made of many lines. This code works except for TextBox1 line.I like to print * signs for every line sent to indicate the system is working.[code]The routine waits and pumps out all of the * signs after the transmission is completed.

1- How can I place one * per line of transmission in TextBox1?

2- Is there an easy way to add 15milisec of delay at end of each line?

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

Easier To Convert C# Asynchronous Socket Code Into .net Than Convert .net Code To C#?

Dec 8, 2009

my project was intially mandated to be done in c#.however a large contributor to the project wrote much of the business logic, which he knows well, in vb.net.How difficult would it be to convert the following c# code into vb.net.

[Code]...

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

.net - Finding Out Which Instance Of A Form Initiated Another Form Or Module

Oct 5, 2010

I'm trying to figure out the best way to reference a control on a form from within a module. Unfortunately the form is just an instance, so it's not as easy as calling form.control...

Dim ChildForm As New frmSearch
' Make it a child of this MDI form before showing it. '
ChildForm.MdiParent = Me
ChildForm.Show()

That form has an option for printing, which calls another form where certain options are chosen. The print form in turn calls a function in a module, which tries to reference back to the origional form.

childform as new frmSearch -> frmPrintForm -> sub okToPrint (in module Print)
okToPrint tries to reference a listview on frmSearch, but can't find it.
For Each itmX In frmSearch.lstResults.Items

So the solutions I can think of off the top of my head are:

1. Somehow divine which form is the caller of frmPrintForm

2. Pass ChildForm to the frmPrintForm as a variable to be passed on to module Print..

3. Use frmSearch directly instead of using an instance of it.

Number 1 would be my preference, as I don't want to have to pass forms around like that.

View 4 Replies

Close A Modal Form From Who Initiated Modal One?

Feb 25, 2011

I have a parent form (form1), which is calling a second form (form2) as modal.[code]...

No form2 is modal. Closing this form2 from the form itself is clear.But how can I close the form via myform2.close from form1 via an event handler?

View 6 Replies

Database Accessing An Initiated Class From Another Class?

Oct 9, 2011

I have the following defined in my "Form1":So that I can access all my database functions anywhere in the main form (database connection is initialized via the "private sub new()" function in the DatabaseManager class.The works fine for all queries done in form1, however I have many other classes I'd like to be able to access the database from.Does anyone know how to access the initiated class in my example? Since right now it is initiated in the main form, if I try to access any functions inside any ot

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







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