Windows Service - Using Sockets To Send / Receive Data
Jul 27, 2009
I have written a windows service that uses sockets to send receive data, it works fine when the server has been running and all other services have started, but after a reboot it does not work. Now I know its probably dependant on another service and I know how to add dependencies, but how do I work out which services its dependent on?
I'm completely new to sockets etc.I'm trying to create an app that'll allow someone to send short information messages to several other people with the same app, using the internet and sockets(?)I've tried using code from online, but I'm getting no where.
I have created a Client that can send and receive data via TCP sockets. The objects stored on the serverside are the *exact* same object used for the client. They use the same send and receive protocols.
Now, when i send a string from the server to the client , it does precisely what it should do. However when I send a string to the server.... I do receive the string as an equal length of NULL characters. I run the server and client locally.
Basicly what can influence the behaviour between two completely identical objects performing the exact same task? I wonder if there is some socketflag issue if the TCPlistener.accept function returns a completely different setup then the one I R used to.
(if it is of any interest, the send protocol is asynchronious)
I want to send image from server to client via .net Sockets and assign it to a picturebox. but I got problem in receiving data, it's 'Server' side code:
I have an array of IP addresses, and I want to send the same data to all of them. I could just send the loop code that sends data but I think there's a better way of doing this.
I am sending data to my server (MyServer.com) from microcontroller device using socket connection, I want to receive data using Socket and store in access database need a tracker for this work
I have created a program to send and receive data from a serial port, some of the data needs to be stored in certain strings for a export to excel. However the data takes while to to send be sent back. So in order to get the right information in the right strings I have to put pauses in my code. I have added a timer to my form:
On my timer's tick event I have the following code:
Public Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick iTick = iTick + 1 End Sub
I need to send data via serial and wait for and answer (VB.NET).Right now i'm doing it this way:SerialPort1.Write(sel & Chr(13))Thread.Sleep(50)aaa = SerialPort1.ReadExisting()If i do not thread.sleep, i get nothing, i supose it's because the machine is too fast.
I am trying to set up a program that allows you to open multiple COM ports and then select which COM port you send data down. The computer i am using has 18 COM ports. Also on the first code it shows the ports are open they just wont receive anything.
from and to a text file. that's no problem and was done within a hour. (tnx to google)Now the problem. i want this textfile to be online. Normally with webpages you can read and write a file very easy but i've never done this withSo far the read code works. write code works in local mode, the only thing is he won't write to an online file.i don't get any errors the code looks fine for the debugger.the code so far (local mode for testing)
I'm trying to setup an asynchronous client and I can send/receive one command and response, but when I try to send the second command, the command is sent (I verified by code inspection), but I am getting no response.
Heres the code, a majority of it is from the Microsoft example.
Option Explicit On Imports System Imports System.Net
In our project we've decided to put an exam generator using vb.net and after generate you can send it to client computer/students. *server computer/teacher will the one who will use exam generator and send it to the client computer/student*student will recieve it and then send it back again to the server computer/teacher*teachers will going to generate an exam depends on the type of exam, so i think im going to make it a wizard type environment
I have a USB modem that can detect caller ID and can detect dialled digits when special AT commands activated, How to send and receive data. The sent data will be the AT command such as AT+VCID-1 to activate the caller ID, the received data will be caller ID information and the digits dialed. I'm new to prgramming and using Visual Basic 2008 Express.
I am trying to send email from a Windows service but understand that I cannot use MAPI to achieve this. It is a simple service that monitirs a folder and I wish to notify a user by email that a file has been added to the folder.
I have a windows service application to send emails.The same code works well with windows application but not with windows service.
Private Sub Timer_Elapsed(ByVal sender As Object, ByVal e As System.Timers.ElapsedEventArgs) Handles Timer.Elapsed EventLog.WriteEntry("Started!!!!") Dim cmd As System.Data.OleDb.OleDbCommand[code].....
i have a task to create a TCP Server (a program that is listening on its network card interfaces for incoming data stream).I have search on the internet and i found that i can use two methods : Socket or TCPListener class.I have created an example for Socket class, but i wondering how could i test it? I need to check that if another computer in the network send some string data to the listener computer , then this message should be displayed.Here is the example from microsoft that i am using for TCP Server using Socket:
Public Shared Sub Main() ' Data buffer for incoming data. Dim data = nothingc[code]....
But it does not work because of the PORT setting.If in the TCP Server i have "Dim localEndPoint As New IPEndPoint(ipAddress, 0)" the client crashes, but if i change the port from any (0) to 11000 for example,the client works fine.Do you know why?
Later edit2:Maybe i should have started with this question:Which method is recommended for my scope?asynchronous or synchronous method ?
I'm trying to make a LAN IM client using the net send command and I was wondering if there is any way to capture the text of the messages received through net send and display them in a label.
So basically I would like to know what goes on behind smtpclient, webrequest and all those.
I would like to know if its possible to connect to an smtp server with sockets. Also, can anyone recommend a good OOAD(object oriented analysis and design) tutorial or book?
first asking an question and then introducing but i kinda need some help in here.First of all im not new to VB, But i am to VB.NET and espessially socket programming.Now i need an way to send the lenght of the string being send in bytes before the string itself so <lenghtinbytes><string>.
ive tried so many things, and its possible because the client itself does it too...but just cant find an way.
I'm writing a replacement for an old library we use at the office to communicate with a rather clumsy and old custom-made C++ framework that takes requests via sockets in order to communicate with a bunch of other systems. The problem is that it will only take plain text messages containing a string which must be formatted in a very specific way.The problem I'm facing is that I haven't found so far a way of sending plain text through the socket. The Send method of the socket will only take byte arrays, and while the listening point receives the data, it gets there completely scrambled, and there's no way I can mess with that in order to convert the byte array back to plain text. I need to be able to send plain text, not byte arrays.[code]
i have a Windows service that is hosting a WCF service through net.tcp and this is working great. I have also created a WCF service application. I am trying to add the net.tcp service reference to the service application. Then I add it to the GAC that goes ok but if I try to RegAsm the WCF service application to allow it to be called from Server.CreateObject I get the error:
Warning: Type library exporter encountered a type that derives from a generic class and is not marked as [ClassInterface(ClassInterfaceType.None)]. Class interfaces cannot be exposed for such types. Consider marking the type with [ClassInterface(ClassInterfaceType.None)] and exposing an explicit interface as the default interface to COM using the ComDefaultInterface attribute.
It does not work. I have tried to call it through a class library but this does not work either as the end point is not set correctly.
I found similar forum thread [URL], but he don't have answers. How I can conncect | send | recive data using tcp connection with specific internet service (not web).
I want to build a service that "listens" for data coming in from various ports which then moves the data to the main application.To manage the settings for these services, I want to create some sort of custom management console to change the settings, start/stop the service and view the incoming data.Since you can't test the service in debug mode, would you suggest building all the logic in a win form app, making sure it works before you move the logic to a service project?Secondly, how can the incoming data being read from the service be propagated to the management console application for users to "test" and view the data?
I'm using a web service programmed in Visual Basic .NET 3.5 to receive a JSON Array sent from other application.
I'm sending a JSON string like this one: [{"idRecoleccion":1,"PIN":"553648138"},{"idRecoleccion":2,"PIN":"553648138"}] And I'm receiving the code in Visual Basic .NET as follows:
I'm experiencing a weird problem. I need to create a Windows service that listens to a port for data. The data is comma separated, so I need to split it up and just write a few of the separated values to a file. This is a brief summary of my code:-
Do While True
tcpClient = tcpListener.AcceptTcpClient() networkStream = tcpClient.GetStream() Dim bytes(tcpClient.ReceiveBufferSize) As Byte
[code]....
Now the above code works fine. But suppose I just want to write only (2) to file i.e 2 of the comma separated values, problems arise. This is what happens:-
If I include both lines (1) and (2), output file = lines (1) and (2) If I include only line (1) and comment out (2), output file = line (1) If I include only line (2) and comment out (1), output file = BLANK ???
Since a few months I want to learn how to receive and send packets. Since WinSock doesn't work I think it'll be quite hard to get an easy way to do it.
I want to be able to send and get packets as a client. (TCP) I know that I need System.Net.Sockets, and that's quite everything...