tcp

[C#] Simple Asynchronous TCP Chat Application [C#]

Ok, I studied a bit on asynchronous TCP network connection. I tried making one but failed. What I want to do is make sure the server or client is always ready to receive a chat and is able to send a chat any time. I do not want them to be on alternate mode. e.g. Server Send while client waits to receive thus client can't send at that t...

How do I dump the TCP client's buffer in order to accept more data?

I've got a simple TCP server and client. The client receives data: received = sock.recv(1024) It seems trivial, but I can't figure out how to recieve data larger than the buffer. I tried chunking my data and sending it multiple times from the server (worked for UDP), but it just told me that my pipe was broken. Suggestions? ...

erlang: gen_tcp:accept limitation

hi I am interesting what are the limits for gen_tcp:accept function? I mean what is max concurrent connection count? Or how can it be configured? (gen_tcp setting, ulimit or something else) how much get_tcp can accept connection per second? ...

TCP connection failure

I’m having trouble with a simple TCP socket with the connect() and read() function. This program works if I start the server first, and the client second. However, when I start the client first, it continues to try to connect to the server, then when I start the server, it connects but the subsequent read returns 0 bytes. This suggests t...

Keep Alive TCP/IP connected sockets over the Internet - when? how? and how much?

TCP/IP connections KeepAlives are specified to be at least once every two hours: http://tools.ietf.org/html/rfc1122#page-101. The problem is this was written in 1989 and is concerned about the cost of sending the extra KeepAlive packet! Yet it still is the default time most OS's in accordance with the spec send out KeepAlives down a conn...

Examine open TCP connections on Mac

What is the Mac equivalent of TCPView or CurrPorts? I've never used Mac before, so I'm clueless. ...

What's the simplest way to measure the throughput of a device

Hi! I need to measure the throughput of an android device. I was thinking of measuring it using a simple client-server code working with TCP, which should be quite simple. Would you say the TCP overhead would lead to an approximation within 10%/20% of the real throughput? Thanks! ...

TCP - How will the peer side know when an accept fails?

As far as my understanding goes, once we complete the 'listen' call with bound socket, all the TCP connections initiated by the client starts succeeding, but, when the accept is called, there is a good amount of possibility that the accept call might fail (due unavailable memory or file descriptors crossing the limit etc). I ran some s...

C# TcpClient not sending or reading 100% of data?

Hey all. I'm writing a simple client/server application (just for the experience, networking is fairly new to me) where the client sends the server data and the server outputs it to a textbox. It all works fine, except for one small detail... It seems sometimes a connection is made, but the data isn't being sent or read (can't work out w...

TCP client server conversation in endless loop??

I'm trying to access a web server which is sitting behind a Netcomm 3G10WVR modem/router. The web server's port 80 is port forwarded to port 4476 on the router. The tcp conversation seems to proceed ok but then gets into a (seemingly) neverending loop. I exported the conversation from wireshark and deleted the irrelevant lines - the rema...

Stop a Asyncronous TCP Application Properly

Hi i have a disconnect button click event in my SERVER application as follows.Before it dc, it will alert other clients by sending a "/exit" command.After that it will shutdown its connection. private void stopButton_Click(object sender, EventArgs e) { byte[] exit_command = Encoding.ASCII.GetBytes("/exit"); g_server...

C++ network programing in linux: Server Questions

I am learning how to network program using c/c++ and I have created a server(TCP) that is suppose to respond in specific ways to messages from a client in order to do this I created a class that the server class passes the message to and returns a string to report back to the client. Here is my problem sometimes it reports the correct s...

Are there C++ versions of PHP's fsockopen, fread, fwrite, fclose?

Are there C++ versions of PHP's fsockopen, fread, fwrite, fclose or anything similar? I'm using Windows (MFC) and TCP if that changes anything. ...

TCP server listen to mulitple clients at once in C

Hi! I have written C code for a TCP server to listen to one client at a time.. but I'm having difficulting finguring out how I can get the server to listen to multiple clients at one time. Does any one know of a good tutorial or example explaining this? Thanks! ...

C# TCP Socket Programming - Determining whether a connection has been dropped

I am trying to discover whether a TCP connection is being dropped at the server after a given interval and have written the following code; var tcpClient = new TcpClient(); tcpClient.Client.SetSocketOption(SocketOptionLevel.Tcp, SocketOptionName.KeepAlive, true); tcpClient.Connect(Ip, Port); var status = tcpClient.Connected ? ...

Error and unexpected behavior with TCP connection

hi.. I am wanting my TCP server and client to "talk" to each other depending on what the other says. But when I run, it seems to go through one iteration, but then both the server and client seem to just "hang" there. Once I kill it on the client side, I end up getting a broken pipe error. Can anyone interpret what I am doing wrong he...

using select() to listen to multiple clients (TCP)

hi.. I have developed (TCP) server to listen to a client and interact with it. Now I'm trying to adapt that server code to listen to mulitple clients. I am wanting to use select, but I'm getting confused with some of the examples and explainations I've found. I have been reading: http://support.sas.com/documentation/onlinedoc/sasc/doc7...

dbus-send to remote machine

What's the syntax for sending a dbus message to another machines dbus daemon using dbus-send? I see there's TCP/IP support for the destination address, but I can't find any docs on how to actually specify the address. ...

C# - Multiple TCP connections on one port?

What I'm wondering is, am I allowed to do this client_db.clients[numberOfClients].sock = listener.Accept(); For my networking class I'm writing a chat client and a server that it connects to. I have an array of client objects that contains various info about each of the people connecting to the server. Before when dealing with one cli...

List used TCP port using C#

This is the answer to my questions. How to list binded/used TCP port in C#. Used modified code from jro static void ListUsedTCPPort(ref ArrayList usedPort) { IPGlobalProperties ipGlobalProperties = IPGlobalProperties.GetIPGlobalProperties(); IPEndPoint[] tcpConnInfoArray = ipGlobalProperties.GetActiveTcpLis...