tcpclient

TCP/IP Connects and Sends But Doesn't Work After Initial Sends

只愿长相守 提交于 2019-12-24 10:19:14
问题 HELP! I'm Going Crazy! I'm using a Visual Basic 6.0 Winsock for the server. I'm able to keep an active connection and I even receive from my Android App to the VB App "VER:Android,LAT:28.111921,LNG:-81.950433,ID:1038263,SND:0,VDO:0"> Which I parse and put the data in their fields. After my initial connection I try to send a simple message from VB to the Server and I never receive it. What I do notice whenever I close my VB.NET app I recieve this in my LogCat: 11-26 15:38:16.567: I/TcpClient

Are TCP setup times this slow (1 second), typically?

落花浮王杯 提交于 2019-12-24 08:30:56
问题 My scenario is that I have a hundred small text files that I want to load, parse, and store in a DLL. Clients of the DLL are transient (command line programs), and I would prefer not to reload the data on every command line invocation. So, I thought I would write a Windows server to store the data and have the clients query the server using TCP. But, the TCP performance was really slow. I wrote the following code using Stopwatch to measure the socket setup time. // time the TCP interaction to

How do I keep TCP/IP socket open in IIS?

自作多情 提交于 2019-12-24 06:37:54
问题 I have the following use scenario: User logs in to ASP.NET application; and at some point makes a connection to remote TCP/IP server. The server's response may come after significant delay (say, a few hours). Imagine that the user submits a batch job, and the job may be running for a long time. So, the user may close the browser, get some coffee and come back to see the results later. However, if client closes the connection, the server will never return the results. So, keeping Socket info

TCP Client through multithreading in C#

那年仲夏 提交于 2019-12-24 02:12:53
问题 I am connecting to Gmail account using TCP client for reading emails. It returns SslStream for the TCP connection. It works fine for single thread environment but performance is very poor in terms of speed. I need to optimize the project so that its speed can be increased. I have implemented multithreading which increases the speeed but application gets hang at some point. Is it thread safe to use TCP connection (global member)? OR Can I create multiple TCP connections and pass to the thread

How do i check if TcpClient is connected?

馋奶兔 提交于 2019-12-24 01:46:13
问题 When my client app closes the socket or even terminates my server still thinks its alive. I even check TcpClient.Connected then i see this. I bolded the important part true if the Client socket was connected to a remote resource as of the most recent operation ; otherwise, false. How do i know if the socket is closed or not? At the moment I have to do an operation and get an exception to discover if its opened or close 回答1: There are so many things that can break communications over a socket,

Having trouble sending three or more packets consecutively

↘锁芯ラ 提交于 2019-12-24 00:31:53
问题 I am trying to implement a Client/Server model using TCpClient , with its Networkstream.Write()/Read() functions sending/receiving a byte array. It works most the time, except if I try to send three or more byte arrays in a row right after one another. The client says it sends them all, but the server only receives the first two. Below is the code I use to write from client to server. byte[] buffer = p.toByteArray(level); stream.Write(buffer, 0, buffer.Length); stream.Flush(); Is it

I want to android app A to communicate to android app B using tcp method

梦想与她 提交于 2019-12-23 22:25:37
问题 I want to make two android application that communicate each other using tcp in the same device itself . Say when a user from Android A app. clicks a button it must bring Android app B to the front and show a message from Android A and when user clicks a button on Android B ( say processed finished ) it must get behind and Android A must come to the front of the display How can this be done can it be done by tcp method or what exactly I must use for this 来源: https://stackoverflow.com

TcpClient/NetworkStream not detecting disconnection

不想你离开。 提交于 2019-12-23 10:07:44
问题 I created a simple persistent socket connection for our game using TcpClient and NetworkStream . There's no problem connecting, sending messages, and disconnecting normally (quitting app/server shuts down/etc). However, I'm having some problems where, in certain cases, the client isn't detecting a disconnection from the server. The easiest way I have of testing this is to pull out the network cable on the wifi box, or set the phone to airplane mode, but it's happened in the middle of a game

tcpclient receiving data incorrectly

穿精又带淫゛_ 提交于 2019-12-23 04:58:07
问题 Not sure if this is the TCPClient or something else, I have used a network sniffer to check what is being sent and received from the server and the data is correct however my software is receiving the data incorrectly. Let me explain, I transmit an enquiry byte (05) I get a acknowledgment back (06) then I transmit some data that starts with a 9B byte, once this has sent I should then receive a single 06 byte and then after that byte I should get a C5 byte, however according to my software I

NetworkStream BeginRead / EndRead

穿精又带淫゛_ 提交于 2019-12-23 03:56:11
问题 I'm really new to C# programming and I'm developing an application based on a TcpClient. I would like to know how to use BeginRead & EndRead, I've already read MSN documentation but doesn't help. I've this : private void Send() { TcpClient _client = new TcpClient("host", 80); NetworkStream ns = _client.GetStream(); ns.Flush(); / ... ns.Write(buffer, 0, buffer.Length); int BUFFER_SIZE = 1024; byte[] received = new byte[BUFFER_SIZE]; ns.BeginRead(received, 0, 0, new AsyncCallback(OnBeginRead),