I am using raw sockets with TCP. Whenever a packet gets sent to me, my computer send a RST packet back. I tried http://udi.posterous.com/suppressing-tcp-rst-on-raw-sockets, which isn't working:
int main(void) {
struct addrinfo *info, hints, *p;
int status, sock;
memset(&hints, 0, sizeof(hints));
hints.ai_family = AF_UNSPEC;
h...
hi, I would like to establish a connection between 2 computers using socket. For this purpose one of them is a server and this is the code I've write:
sock= TCPServer.open('localhost', 6666)
sock.accept
the client try to establish the connection:
client = TCPSocket.open(ip_server, 6666)
but is not working. I've notice scanning serv...
I've created a simple test app (Python 2.6.1) that runs a ThreadingTCPServer, based on the example here. If the client sends a command "bye" I want to shut down the server and exit cleanly from the application. The exit part works OK, but when I try to re-run the app, I get:
socket.error: [Errno 48] Address already in use
I tried th...
I am trying to get an ip address that is bound to receiveSock. How can i get it.
Ques 1:
ipEndReceive = new IPEndPoint(IPAddress.Any, receivePort);
receiveSock = new Socket(AddressFamily.InterNetwork
, SocketType.Stream, ProtocolType.Tcp);
receiveSock.Bind(ipEndReceive);
When code reaches Bind function. An er...
ipEndReceive = new IPEndPoint(IPAddress.Parse("127.0.0.1"), receivePort);
receiveSock = new Socket(AddressFamily.InterNetwork, SocketType.Stream
, ProtocolType.Tcp);
ErrorLog.WritetoErrorlog("Trying to Bind IP Address Stored in Variable : "
+ipEndReceive.Address.ToString()
...
I would like to test the logging that happens in our app (an embedded ftp server) when a 'connection reset by peer' error occurs. This post explains the source of the error pretty well, but doesn't really explain how to cause one. Does anybody know a way to trigger this error for a TCP connection?
...
Hello all,
I don't want to reinvent the wheel with another TCP server wrapper, so are there any good out of the box open source TCP server wrappers for .NET C#?
Indy C# is kinda dead, and I cannot find any other packages that are atleast a bit maintained..
...
Hi
I'm building a socket , using
CFStreamCreatePairWithSocketToHost(kCFAllocatorDefault,
(CFStringRef) yourHostAsNSString,
yourPortAsInteger,
&myReadStream,
&myWriteStream);
and I s...
Hello everybody.
I'm looking for something,I don't know if it exists.
I have a Java server, something like
while (true) {
try {
Socket socket = server.accept();
new ConnectionHandler(socket);
System.out.println("Waiting for a new client message...");
} catch (IOEx...
I was told that one common reason of storing sessions in a database is to make it cross-server. But isn't a TCP connection persistent until one closes the browser? Why the next request may switch a different server?
...
I am reading "Unix Network Programming" and tcpdump the packet generate by the example. The example is just send out a packet contain string "liha".
I read the TCP/IP RFC and found normal IP header is 20B. and normal TCP header except data is 24B.
So, there are 8B before string "liha" in the captured packet. Are "0121 3d2a 0120 b43e" ...
Background:
We have a client/server application that uses a persistent connection to the server.
Benchmarks show that it is many times faster to use an already open connection rather than spend significant time (2.5 seconds) setting up a new connection (crypto).
Unfortunately, the old connection may be stale.
Is there a way to wait f...
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...
Hello, I'm trying to make server/client in Qt.
TCP Server takes maximum 4 connections from client.
To create...
// server.h
class Server : public QTcpServer{
...
QList<QTcpSocket *> list;
}
// server.cpp
Server::start(){
QTcpSocket *curr = nextPendingConnection();
connect(curr, SIGNAL(disconnected()), curr, SLOT(delet...
For a socket server, what are the costs involved in keeping 1000s of tcp connections open, but only few clients are actually communicating? I'm using single threaded poll/select based server. Also, what is the max open-socket limit of linux kernel(plz don't give conf file suggestions. i want theoretical limit)?
...
Hey. I'm converting a 2.6.5 application to python 3.1. I'm trying to convert a byte order received through socket.recv() into a string, by doing the following:
str(temp, 'UTF-8', 'ignore')
The problem is unknown characters are removed ("ignored"), such as \x00 and \xff (WebSockets characters), I do want to convert the byte order to a ...
Hello,
I'm looking for a book that covers TCP protocol from TCP/IP family and contains examples in C#.
I've found this one:
http://www.amazon.com/TCP-IP-Sockets-Practical-Programmers/dp/0124660517 - It seems good. The only drawback is that it's written in .NET 1.1 or so
Thanks for tips!
...
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...
While comparing java TCP socket performance between RH Linux and Solaris, one of my test is done by using a java client sending strings and reading the replies from a java echo server. I measure the time spent to send and receive the data (i.e. the loop back round trip).
The test is run 100,000 times (more occurrence are giving similar ...
Is out there any sample of reading http requests using TCP socket collecting data from them (like emulating Http server in some way) so I wanna to keep data like senders IP:PORT, request body and so on.
So has any one seen such thing in OpenSource projects or do you know how to create it? (if so please provide siple code example)
...