Hello,

I'm trying to set up a TCP connection to graylog, in order to get data in.
Currently i have a UDP connection set up, but i want confirmation from 
graylog that my log has arrived.
So currently i'm using this piece of code:

TcpClient client = new TcpClient(myConfig.ServerIP, myConfig.ServerPort);
                    byte[] sendBytes = Encoding.ASCII.GetBytes(JSONMessage);
                    NetworkStream stream = client.GetStream();
                    stream.Write(sendBytes, 0, sendBytes.Length);
                    sendBytes = new Byte[256];
                    String responseData = String.Empty;
                    Int32 bytes = stream.Read(sendBytes, 0, 
sendBytes.Length);//>>>>"crash" position<<<<
                    responseData = 
System.Text.Encoding.ASCII.GetString(sendBytes, 0, bytes);
                    Debug.WriteLine("response:");
                    Debug.WriteLine(responseData);
                    stream.Close();
                    client.Close();

I can see that graylog has received something because the TCP input shows 
me there are bytes received, so it does connect, but it doesn't show up in 
the search results.
Also at the crash position, which i have marked above, it just doesn't 
receive any kind of handshake back. It waits like a second or two, and 
after that just skips all of the remaining code.
Resulting in the client and stream not closing.

Ports and IP are correct.

Am i missing something?

Thank you in advance!

-- 
You received this message because you are subscribed to the Google Groups 
"Graylog Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/graylog2/2430c42a-9bcd-42de-bd01-231ec5a6fe61%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to