Tagged Questions
1
vote
1answer
17 views
TCP Socket binding timeout
I have questions about the time limit for the tcp binding socket in server side.
In my survey, I found if the tcp client socket send the close message to the server, the client will enter to ...
1
vote
1answer
42 views
Handling many connection by Python [closed]
I've a client/server application. Client App will be coded on C++. On Linux we have server program. This server will handle thousands of users and millions of requests and those thousands of users ...
0
votes
0answers
27 views
How to use socat to transfer serial commands in a script over TCP/IP?
I have a web application that will constantly post some queries and get replies from a device through the serial port on Raspberry Pi. Like this:
@cherrypy.expose
def login (self, **data):
...
-1
votes
0answers
47 views
Any java/python socket server framework I can reuse for my multiple chess server (1000+ clinets online)? [closed]
I am trying to rebuild my chess server , previously I implement it based on the open source lighthtttpd, but Now I find maybe "C" is not a good choice to process the game logic, so I am seeking to ...
0
votes
0answers
22 views
Networking with Python: No response from IP Phone
I'm an Automation Developer and lately I've taken it upon myself to control an IP Phone on my desk (Cisco 7940).
I have a third party application that can control the IP phone with SCCP (Skinny) ...
0
votes
0answers
21 views
how to make my tcp socket use a socks4/5 proxy
I first make a socket with something like this:
self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
Now i want that socket to send the packet to the proxy server which will then ...
0
votes
0answers
35 views
Python / MySQL / Can't create TCP/IP socket (24)
After some hours of operation my python script is spitting the following message.
ERROR protocol # [Failure instance: Traceback: <class '_mysql_exceptions.OperationalError'>: (2004, "Can't ...
0
votes
3answers
52 views
How do I receive and manage multiple TCP connections on the same port?
I have a number of clients who need to connect to a server and maintain the connection for some time (around 4 hours). I don't want to specify a different connection port for each client (as there are ...
0
votes
1answer
35 views
Multiprocessing with Python and Arguements
related to my last post (Which somehow got marked off and closed),
I wrote some code to create a thread for a command handler for my python TCP listener. What basically happens is that I send in some ...
0
votes
1answer
52 views
Developing a Game Server [closed]
I am starting a project/game and I'm in charge of the backend weird stuff. I decided to make it in Python and receive data from the frontend where the user plays the game with a TCP connection. First, ...
1
vote
1answer
87 views
Creating a client and server program with python for sending TCP and UDP packets
I have to write a client and a server program with python were the user gets ask if he would like to send via TCP or UDP. The Server simply sends back the data because i want to find out how long it ...
0
votes
3answers
76 views
Why Should I Set a Conservative Max Byte Size on a Socket's 'recv' Method?
I am building a client using Python's socket.socket class that receives data which varies in size (usually between 500 and 5,000 bytes but it is theoretically possible for the client socket to receive ...
1
vote
1answer
125 views
TCP server with Python: How to optimized my implementation?
I would like to implement a TCP server using a Python script.
The server should basically do the following task:
It will be cyclically polled by a remote client, then reads certain data on its local ...
5
votes
1answer
250 views
python unpack buffer data
I am using the rlm_python module in radius and its get the DHCP location option 82 from coovachilli in hex or binary format,
catching it as a string shows as this value ...
0
votes
1answer
52 views
send a variable to a TCPHandler in python
I'm confused as to how to send a variable to a TCPHandler using SocketServer.TCPServer in python..
HOST, PORT = hosts[0], args.port
server = SocketServer.TCPServer((HOST, PORT), METCPHandler)
...
1
vote
1answer
221 views
using python to send an image over TCP to c# server
I am working on a project that uses a python script to send an image taken with a webcam to a c# webserver using sockets. I am currently sending strings to the server from the python client using code ...
2
votes
1answer
171 views
AES encrypted File transfer over TCP socket; padding issue
I'm trying to do a file transfer using encrypted TCP socket with AES 256.
If I transfer a file without encryption, it works fine.
If I send small commands (such as 'ipconfig') to the client or ...
0
votes
1answer
97 views
How to force-quit a CLOSE_WAIT socket in Python?
I'm using a pile of sockets in my Python script, perhaps 20/s. The are ephemeral, done in three seconds. I've tried to do a good job of sending socket.close() to everything, but for some reason ...
0
votes
1answer
125 views
Add length prefix to DNS request using TCP and Scapy
In the RFC 1035 about DNS, it's written :
4.2.2. TCP usage
Messages sent over TCP connections use server port 53 (decimal). The
message is prefixed with a two byte length field which ...
1
vote
1answer
204 views
Scapy DNS request malformed only with TCP
I use scapy and python to build my DNS request. No problem for UDP request but when I want to use TCP (with exactly the same request that I use with UDP), Wireshark say that my DNS request are ...
0
votes
3answers
79 views
Does File Exist on Client Python TCP server
I am trying to make a TCP port server in python. Here is my code so far:
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('',4000))
sock.listen(1)
while 1:
...
1
vote
1answer
62 views
Python threading error
I am developing a Python application to transfer files using TCP and is new to Python language. I have already coded out the client side code and server side code and it is working if I run them ...
0
votes
0answers
33 views
Permission denied when using app engine app as server
import webapp2
from socket import *
class MainHandler(webapp2.RequestHandler):
def get(self):
self.response.write('Hello world!')
serverport = 12001
...
3
votes
1answer
162 views
Twisted: Close connection after connectTCP without losing other connections
I'm new to Twisted, and I'm trying to figure out how to implement the following.
I have a server, which takes a message from a client. This server, however sends the message from the client to ...
0
votes
3answers
305 views
python TCPServer address already in use but I close the server and I use `allow_reuse_address`
Here is my code to run the server:
class MyRequestHandler(SimpleHTTPServer.SimpleHTTPRequestHandler):
#....
PORT = 8089
httpd = SocketServer.TCPServer(("", PORT), MyRequestHandler)
...
0
votes
2answers
100 views
What does this socket.gaierror mean?
I'm new to python and going through a book, Core Python Applications 3rd Edition. This is the the first example and already I'm stumped with it. Here's the code with the error at the end.
...
1
vote
1answer
145 views
gevent TCP server on Windows
I've been trying to create a TCP server with gevent without (any major) success so far. I think that the problem lies within Windows ( I've had some issues with sockets under Windows before ). I'm ...
0
votes
0answers
60 views
using twisted to broadcast a chat message from a server
I am trying to alter the example from Ray Wenderlich's site on making a chat system:
http://www.raywenderlich.com/3932/how-to-create-a-socket-based-iphone-app-and-server
Essentially, I'm trying to ...
0
votes
1answer
48 views
Is it possible to override the default socket options in requests?
I've written a very simple client for a rest API using the excellent requests library for python. Everything works great util I run the client through a loadbalancer, which sanely detects idle tcp ...
0
votes
0answers
55 views
Scapy: error when recomputing checksum
Any idea what this error might be caused by?
Traceback (most recent call last):
File "/home/myProject/myScript.py", line 400, in aFunction
packets = map(recomputeChecksumOnePkt, packets)
...
0
votes
1answer
49 views
How to get a python SocketServer to received until string is terminated with NUL
In Python, how would I go about writing a TCP SocketServer receiving a string until a NUL character (\0) is found? After the string is received fully, I need the socket to continue to be able to ...
0
votes
1answer
90 views
Using sockets with wxpython
I have a TCP server and a TCP client.
I want to make a GUI version of the code below, using wxpython.
I have the GUI interface script ready, but, I am having problems merging the two scripts.
How ...
1
vote
1answer
201 views
Python 3: TCP Client/Server Broken Pipe Error
I'm writing a TCP client/server and I've been hitting this broken pip error in the latter part of the code. I have been unable to isolate the cause due to a limited understanding of Python and socket ...
0
votes
1answer
188 views
increase tcp receive window on linux
Similar to Setting TCP receive window in C and working with tcpdump in Linux and Why changing value of SO_RCVBUF doesn't work?, I'm a unable to increase the tcp receive window greater than 5888 on ...
0
votes
0answers
144 views
Teltonika FM1100 and TCP listner
Hy, here i am...
i'm writing a tcp listner in python to read and communicate with teltonika devices but i've problems when after receiving imei code, i try to send the akcnowledgment to the device, so ...
1
vote
0answers
87 views
TCP server option not working in program running on RPi
I have this program running on my RPi(sudo ais_rx.tcp -d --tcp):
https://github.com/chgans/gr-ais
I have gotten it running and can create an output file. I can not get the TCP server option to ...
0
votes
1answer
259 views
Python: Passing Multiple Variables Across TCP Client/Server
I'm creating a TCP client and server using Python 3.3 and I'm new to using both Python and sockets. My issue is that I need to be able to store anything passed across the connection as a separate ...
0
votes
1answer
56 views
Can't send correct value over a socket using Python
I'm new to using Python and sockets in general (only started yesterday) so I've been having a lot of issues trying to set up a TCP client and server. The issue I'm having is that I want to send a key ...
10
votes
1answer
178 views
S3 Upload with pycurl interrupts
I'm using pycurl as a back-end for the boto Python library. It is very fast and versatile but I have the problem that uploads of big files very often fail on connection reset. When I use plain boto ...
1
vote
1answer
358 views
TCP Hole Punching using Java and Python Sockets
I read the paper on TCP hole punching available here.
In order to do this one has to bind the sockets which are used for making TCP connections to a remote host and that which the local host uses to ...
0
votes
1answer
99 views
Android connecting to a Python Server
My buddy made a server in Python and wanted me to create an Android app that connects to it, but I have no idea where to start with that. Here's the code to the server. Can anyone help me out or put ...
2
votes
2answers
190 views
Python Twisted TCP/IP Connection
I have a Linode account and I am trying to communicate using telnet with a basic TCP/IP server written in Python (Twisted), installed in a linode with ubuntu lts:
import os
from twisted.internet ...
0
votes
1answer
191 views
Is this an efficient TCP/IP socket loop for a python client?
I am connecting to a server that will send me streaming data that needs to be processed on a per-line basis. So I have to parse out the individual lines, then process each line. The following code ...
0
votes
1answer
181 views
Python TCP buffer overflow
I have a client server communication, I wrote the following server to handle the incoming message, but If the message is bigger than the buffer than it will be lost. How can I receive the whole ...
1
vote
1answer
169 views
How to set initial sequence number of TCP socket
As a part of testing, I am needing to be able to initialize the ISN (initial sequence number) of a TCP connection to a specific value. Normally this is a randomized value picked by the OS/Network ...
0
votes
1answer
131 views
Python instant messaging program fails to connect with errno 111
I am trying to implement a simple TCP instant messaging program in Python using the socket module. When I use the value returned by socket.gethostname() in connect(), the client works perfectly fine ...
1
vote
1answer
65 views
Python: Easy PC to PC communcation
I am interested in making an application that will transmit strings from one computer to another. I am interested in TCP or UDP communication. I have implemented UDP but it seems to be able to send up ...
2
votes
2answers
608 views
Python: sending data between two computers via sockets
I am working on a script that would transmit the data between two distinct computers with access to the internet. I am using python's socket standard module. It works fine when I run both client and ...
1
vote
1answer
222 views
Unpack requires a string argument of length 44 python
I have while loop for get packets
unpackedData = struct.unpack("!BBHHHBBH4s4sHH4s4s4sHH4s", data[:44])
this line throws exception
Unpack requires a string argument of length 44 python
But ...
0
votes
1answer
113 views
How to get file descriptor for the port on which tcp client has been bound in twisted
How can I get the file descriptor for the port on which the client has been bound.
I want this to share the port in between different processes.
I am able to get the file descriptor for the tcp ...