Re: CANNOT receive UDP data in SERVICE program



Service have to notify service manager during very short period ( 1 sec )
that it started , otherwise service manager stop to run it. Seems like that
what happen with your code
Arkady

"GrepAll" <GrepAll@xxxxxxxxx> wrote in message
news:1187342299.049963.35230@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have found the problem, it's the fault of my NON-standard windows
SERVICE codes.

After downloading a SERVICE source code and copy my codes into it, the
socket works well.

Really strange, I think I should learn more about Windows SERVICE
tech.

Khan,
Thanks for your typing. Although that's not my problem, "netstat -anop
UDP" is really a powerful command I didn't know before.

On 8 17 , 4 08 , "Farooque Khan" <farooque.khan[AT]gmail[DOT]com>
wrote:
On command prompt type 'netstat -anop UDP' and check whether PORT1 is
opened
by service process ID or not (also check the Local Address).

--

Farooque Khan
Project Manager
Infospectrum India Pvt. Ltd.
faroo...@xxxxxxxxxxxxxxxxx
Phone: +91 712 229 3711www.info-spectrum.com

This e-mail may contain confidential or proprietary information. If you
are
not the intended recipient please notify the author by replying to this
e-mail and please note that use, disclosure, distribution, copying or
printing of this e-mail or its attachments is strictly prohibited and may
be
unlawful. Whilst this e-mail has been checked for viruses, the sender
takes
no responsibility and recipients are advised to undertake their own
checks.

"GrepAll" <Grep...@xxxxxxxxx> wrote in message

news:1187331810.184970.29880@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

More information:

I run the server program on the same machine with the one on which the
client service runs, and the recvfrom can get data correctly.

Any advice?

On 8 16 , 10 14 , GrepAll <Grep...@xxxxxxxxx> wrote:
Here is a strange problem, I cannot receive UDP data in the SERVICE
program while it works well in normal Win32 APP.

Problem description:

It's a service program running in the client machine and it works
following these steps:
1. Broadcast online request which brings local command socket port
number #PORT1 (the server program will later send command data to this
port);
2. Create an UDP socket #SOCK1 and bind the socket with #PORT1;
3. Call setsockopt to set a 5000ms TIMEOUT option on #SOCK1;
4. Call recvfrom on #SOCK1 to receive and process server command.

If I build this program as Win32 APP, it works well. But if I build it
as a Win32 service, server program can receive the broadcast data,
while the recvfrom always returns 10060(WSAETIMEDOUT).
In fact I can see the command data in Sniffer, the port number is
right.

Anybody knows the reason?




.



Relevant Pages

  • Re: CANNOT receive UDP data in SERVICE program
    ... UDP" is really a powerful command I didn't know before. ... Broadcast online request which brings local command socket port ... Call setsockopt to set a 5000ms TIMEOUT option on #SOCK1; ... In fact I can see the command data in Sniffer, ...
    (microsoft.public.win32.programmer.networks)
  • Re: CANNOT receive UDP data in SERVICE program
    ... After downloading a SERVICE source code and copy my codes into it, ... UDP" is really a powerful command I didn't know before. ... Broadcast online request which brings local command socket port ... In fact I can see the command data in Sniffer, ...
    (microsoft.public.win32.programmer.networks)
  • Re: problem with Socket.Available
    ... > I try to implement a reusable socket class to send and receive data. ... you will find the code for this class (TcpHelper). ... probably connection closed by peer"); ... > (command, bytesRead, ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: ssh-agent and Linux
    ... where the socket has been created. ... when the "netstat" command can give out the ... Is it not the case that with netstat you need root privileges in ...
    (comp.security.ssh)
  • Re: Possible faulty drive
    ... >> Command Data ... > what I believe to be device geometry information. ... it's just asking for basic device information. ... bytes is the smallest command size, which this is. ...
    (comp.os.vms)