S
Snedker
Hi folks,
If I outcomment the last four lines the service will start.
If I in-comment the line
"int recv = sock.ReceiveFrom(data, ref ep);"
the service will fail starting with error code 3534 (the service
reported no errors). Neither are errors written to the event log.
If I run the same code from a console application, everything works
fine.
The code:
protected override void OnStart(string[] args)
{
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 9050);
sock.Bind(iep);
EndPoint ep = (EndPoint)iep;
byte[] data = new byte[1024];
int recv = sock.ReceiveFrom(data, ref ep);
string stringData = Encoding.ASCII.GetString(data, 0,
recv);
data = new byte[1024];
}
Any ideas why that particular line prevents service from starting?
Regards
Morten Snedker
If I outcomment the last four lines the service will start.
If I in-comment the line
"int recv = sock.ReceiveFrom(data, ref ep);"
the service will fail starting with error code 3534 (the service
reported no errors). Neither are errors written to the event log.
If I run the same code from a console application, everything works
fine.
The code:
protected override void OnStart(string[] args)
{
IPEndPoint iep = new IPEndPoint(IPAddress.Any, 9050);
sock.Bind(iep);
EndPoint ep = (EndPoint)iep;
byte[] data = new byte[1024];
int recv = sock.ReceiveFrom(data, ref ep);
string stringData = Encoding.ASCII.GetString(data, 0,
recv);
data = new byte[1024];
}
Any ideas why that particular line prevents service from starting?
Regards
Morten Snedker