If my client's connection is broken on the other end( kill -9 server). It takes several minutes for the client to determine that something is wrong. Socket.Connected returns true even though connection is actually broken.
What is the fastest way to determine that the connection doesn't exist, once the other end breaks the link?
Client...
I am getting this for all the database connections from my app server..
This exception occured for couple of hours, then got fixed by itself.
Something to do with network connection from the appserver?
java.net.SocketException: Broken pipe
com.inet.tds.SQLException: java.net.SocketException: Broken pipe
java.net.SocketException: Broken...
Well as the title says how can i detect a disconnect with "ReceiveAsync" with all other .net network patterns you could just look if you recived 0 bytes or if any exception was throw however this does not seem to be true any more with this pattern...
My first recive return 0 bytes but the second works thats why im confused....
...
I'm trying to receive some file through sockets in C. But the server sends me 64-byte packets for a 1000000 byte file for example and I get approximately 999902 bytes on the destination file.
while ((n = read(sd, buffer_in, BUFSIZE ))) // BUFSIZE = 64
{
if(n<0)
{
printf("Fail.\n");
fclose(archivo);
return ...
I don't see much use of TCPClient, yet there is a lot of Socket? What is the major difference between them and when would you use each?
I understand that .net socket are written on top of WINSOCK, and TCPClient is a wrapper over Socket class. Thus TCPClient is way up the chain, and possibly inefficient. Correct me if I am wrong.
Than...
Hello,
Please note the question is about using an asynchronous callback mode only on sockets!
I want to build a TCP client that will notify me when a packet is received and when i the socket is being closed,because the feautures that NET offers with beginRecv,endRecv doesn't inform if the connection is still available.
My question:
Is...
How can I send data with PHP to an IP address via UDP?
How can I recive that data on the other computer?
<?php
$fp = pfsockopen( "udp://192.168.1.6", 9601, $errno, $errstr );
if (!$fp)
{
echo "ERROR: $errno - $errstr<br />\n";
}
socket_set_timeout ($fp, 10);
$write = fwrite( $fp, "kik" );
//$data .= fread($fp,9600);
//echo "$data...
Hello everyone and thanks in advance.
This is a last ditch effort to figure out what the problem is or find a better solution.
I am using JSP filter to filter web access to a tomcat web server.
I have a client, a server and the filter.
The client and the filter open up sockets the the server receives them.
I heard that opening up a ...
Right now I have a filter that has the sockets opened in the init and for some reason when I open them in doFilter() it doesn't work with the server app right so I have no choice but to put it in the init
I need to be able to reference the outSide.println("test"); in doFilter() so I can send that to my server app every time the if state...
Apologies for the noob Python question but I've been stuck on this for far too long.
I'm using python sockets to receive some data from a server. I do this:
data = self.socket.recv(4)
print "data is ", data
print "repr(data) is ", repr(data)
The output on the console is this:
data is
repr(data) is '\x00\x00\x00\x01'
I want...
I want to send a UIImage to a server with socket. I'm using this code from ADC:
- (IBAction)searchForSite:(id)sender
{
NSString *urlStr = [sender stringValue];
if (![urlStr isEqualToString:@""]) {
[searchField setEnabled:NO];
NSURL *website = [NSURL URLWithString:urlStr];
if (!website) {
...
I want to convert a UIImage to an NSOutputStream and send it to a server through socket.
#import "Connection.h"
@implementation Connection
-(void) open: (NSString *) h : (int) p
{
strHost = h;
intPort = p;
[NSStream getStreamsToHost:objHost
port:intPort
inputStream:
[receiveStream retain];
[sendStr...
I'd like to write a packet sniffer and editor for Windows. I want to able to see the contents of all packets entering and leaving my system and possibly modify them. Any language is fine but I'd like it to run fast enough that it won't burden the system.
I've read a little about WinPcap but the documentation claims that you can't use ...
I know that file_get_contents can be used to retrieve the source of a webpage, but I want to know the most efficient way.
I have an old class I made a long time ago that uses something like this:
$this->socket = fsockopen($this->host, 80);
fputs($this->socket, 'GET ' . $this->target . ' HTTP/1.0' . "\n");
fputs($this->socket, '...
Here is my code
<?php
error_reporting(E_ALL);
/* Allow the script to hang around waiting for connections. */
set_time_limit(0);
/* Turn on implicit output flushing so we see what we're getting
* as it comes in. */
ob_implicit_flush();
$address = 'localhost';
$port = 10000;
if (($sock = socket_create(AF_INET, SOCK_STREAM, SOL_TCP)) ...
The code:
<?php
error_reporting(E_ALL);
/* Allow the script to hang around waiting for connections. */
set_time_limit(0);
/* Turn on implicit output flushing so we see what we're getting
* as it comes in. */
ob_implicit_flush();
$address = '127.0.0.1';
$port = 11100;
if (($sock = socket_create(AF_INET, SOCK_DGRAM, SOL_UP)) === fals...
Server:
<?php
error_reporting(E_ALL | E_STRICT);
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '127.0.0.1', 11104);
$from = "";
$port = 0;
socket_recvfrom($socket, $buf, 12, 0, $from, $port);
//$buf=socket_read($socket, 2048);
echo "Received $buf from remote address $from and remote port $port" . PHP_EO...
In simulation of a lan-messenger in c# I am using the loopback address just for starters to check the functionality of the code.However after sending a few messages, I am getting a socket exception while using the end-connect method and then a socket exception while sending the data. Is there any reason behind this exception.
privat...
Server:
<?php
error_reporting(E_ALL | E_STRICT);
$socket = socket_create(AF_INET, SOCK_DGRAM, SOL_UDP);
socket_bind($socket, '192.168.1.7', 11104);
$from = "";
$port = 0;
socket_recvfrom($socket, $buf, 12, 0, $from, $port);
//$buf=socket_read($socket, 2048);
echo "Received $buf from remote address $from and remote port $port" . PHP_...
In c# when simulating a lan-messenger I am using the loopback address just for testing the current code and am being able to receive the first message I am sending.However after that there aren't any messages reaching the socket.Is there anything to do with clearing a socket buffer?.please help
This is the callback function when a connec...