tcpclient

Sending binary data with Indy through TCP\IP, how?

Hello. How to send a binary data with Indy components? Which of them is most suitable for this task? I've tried to use TIdTcpClient but it allows only to send strings. I've found one reponce for that problem here but I don't get it. It says about method Write(TIdBytes), but the answer is not clear for me. Does he meant Write to some in...

HttpTunneling a TCPClient application

We have a custom chat application(c#) which uses TCPClient. We are having problem on clients who are behind Firewall or proxy. We know that these client can browse the internet without a problem so we decided to change our TCPClient application so that It uses HTTP messages to communicate. Will it be enough just to wrap our text massag...

How to find server is down,

I have client and server in unix machine, how can i find out my server is down and reconnect to server. without bringing my client down. I am doing connect (), but read() isiving me error Transport endpoint is already connected. I am using C++ in solaris. Can i reconnect back when i start server without bringing client down ?? And ...

.NET NetworkStream closed, how to be sure all data is read?

I've an open TCP connection, and reading using NetworkStream.BeginRead(). Once the connection is closed at either end, the callback is called and the stream object is useless - like documentation says, EndRead() throws IOException or ObjectDisposedException depending in this case on which end terminated the connection. Is it guaranteed ...

Can you send a file larger that the SendBufferSize throuh a TcpClient?

I am experimenting with the Tcp connections in .NET and I would like to send some data that is larger than the SendBufferSize proporty of the TcpClient object. Is it possible to send the data by simply writing to the network stream or do I need to cut it in pices and send those and at the other end create it again? ...

When sending data larger than the SendBufferSize, how will the data be received?

I just asked a question on how to send data larger than the SendBufferSize and the answer was that is would be send in a couple of parts. My second question is how will this data be received? Will it be complete in the network stream or will it get it divided. the first question: http://stackoverflow.com/questions/3097695/can-you-send-...

TcpClient doesn't connect

Hi All I am developing an Tcp client in C# and I am using the TcpClient class. I am not able to connect to the server. Debugging the application I can see that the call to Connect is successfull but after I do this , I check with netstat the status of the connection on both server and client. The result is that the server the connectio...

TcpClient communication with server to keep alive connection in c#?

I've this TcpClient code which works fine. It connects to perl server on linux system and receives anything that server sents to it. Works nicely. public static void Main() { foreach (ProtocolConnection tcpConnection in TcpConnectionsList) { ProtocolConnection connection = tcpConnection; Thread...

Network error handling in silverlight 3

Hi all. We are writting silverlight3 application, which use Tcp connction. Our project use client server architecture. Client part is silverlight application, and server part is winform application. We use TcpClient and TcpListner for connection. We can handle following errors: 1. user shut down 2. users network cable unpluging 3. server...

How to do HTTPS with TcpClient just like HttpWebRequest does?

I've got a communication system based on TcpClient, and it works great except for when it's doing HTTPS to a particular IP. Then it starts to fail. By using a browser or HttpWebRequest, I have no problems doing HTTPS to that IP. I've created a test program to narrow my problem down to its basic essence, you can have a look at it here ...

TcpClient SocketException .NET

hi, my computer configured to have automatically ip address and when i use ipconfig /all command that shows something like below: Windows IP Configuration PPP adapter Broadband Connection: Connection-specific DNS Suffix . : IPv4 Address. . . . . . . . . . . : 95.38.95.204 Subnet Mask . . . . . . . . . . . : 255.255.255.255 Default Gat...

Need assistance with TCP Reverse connection

I am creating an authentication server for some projects I'm working on. This authentication server works by receiving and transmitting data to users trying to authenticate. The user can send data to the server succesfully but when sending back it requires port forwarding. I read a way that I would not require port forwarding by using r...

Connecting to an IRC server using C#

I've been trying my hand at a minimalistic IRC bot, but I can never get a connection to work. I'm doing this via a TcpClient object, which I've seen used in other such projects and those reportedly work. Here's the code. private string server = "irc.freenode.net"; private int port = 6667; private string nick = "testingsharpbot"; priva...

TCPClient seems to not maintain a keep-alive connection, why?

I have the following code using the TcpClient byte[] encbuff = System.Text.Encoding.UTF8.GetBytes("username" + ":" + "password"); string follow = "track=soccer,twitter"; byte[] encode_follow = System.Text.Encoding.UTF8.GetBytes(follow); using (TcpClient client = new TcpClient()) { string requ...

TcpClient.Receive - truncated data

private static Socket ConnectSocket(string server, int port) { Socket s = null; IPHostEntry hostEntry = null; hostEntry = Dns.GetHostEntry(server); foreach (IPAddress address in hostEntry.AddressList) { IPEndPoint ipe = new IPEndPoint(address, port); Socket tempSocket ...

C# TCP Client for WM6

Hello, Im trying to make a TCP client application for a PDA with Windows Mobile 6 Professional. I tried to make it first on my laptop and it worked. The code for the "smart device" is exaclty the same but it doesn't work. Here it is the code: // IP and Port string IP = "192.168.1.68"; int port = 1000; // TCP connection TcpClient conn...

Error when POST and GET via Sockets .NET

I'm trying to post to an ASP.NET Site via Sockets by sending the Raw HTTP Request information however; when trying to read the response I get "Unable to read data from the transport connection: An existing connection was forcibly closed by the remote host." Here is the code I am using Public Function PerformGetRequest() As String ...

How to determine if an HTTP response is complete

I am working on building a simple proxy which will log certain requests which are passed through it. The proxy does not need to interfere with the traffic being passed through it (at this point in the project) and so I am trying to do as little parsing of the raw request/response as possible durring the process (the request and response ...

read xml data over tcp

i'm developing an application that is listening to tcp to get some xml data coming from other devices. i'm use sniffing c# code, and i can sniff all the packets. my problem is that in every packet i can find a Piece of the data in every packet. like this: 1 packet from ip41 data:< 2 packet from ip41 data:?xml versi 3 packet from ip41 ...

Proper implementation of C# TCP reconnecting client

I have to write a TCP Client that will have ability to reconnect to server. The server can be unavailable due to poor network connection quality or some maintenance issues. I'm searching for quality solutions in this area. My current solutions is following: keep connection state in ConnectionState enum {Offline, Online, Connecting} cr...