sockets

Read an XML Data from TCP Port Socket

I have a device which send me data over a particular port. The data is in XML Format. Now I already did a small console application which listen for the data and print out the data on the screen. Now my plans are to deserialize the xml data or I will create the insert statement into the database. 1) The device send me the data every s...

Do I have to listen for server output while sending data to an SMTP server?

I have problems implementing SMTP protocol over WinSock API. Here's what I do now. The client creates a non-blocking socket, connects to the server and exchanges data with it. It uses "send string" primitive which efectively calls send() in a loop until the whole string is transmitted and "receive string" primitive which calls recv() in...

how can an application use port 80/HTTP without conflicting with browsers?

If I understand right, applications sometimes use HTTP to send messages, since using other ports is liable to cause firewall problems. But how does that work without conflicting with other applications such as web-browsers? In fact how do multiple browsers running at once not conflict? Do they all monitor the port and get notified... can...

Using gprof with sockets

I have a program I want to profile with gprof. The problem (seemingly) is that it uses sockets. So I get things like this: ::select(): Interrupted system call I hit this problem a while back, gave up, and moved on. But I would really like to be able to profile my code, using gprof if possible. What can I do? Is there a gprof opti...

Can you add an additional entrypoint to servlet web-apps?

Imagine you have a standard java web-app using plain servlets, or SpringMVC, or whatever. You also want (for whatever reason) a way to talk to the server not using HTTP - I'll use direct sockets as it's the easiest example I can think of. Writing a web-app is easy, you have servlets acting as entrypoints. Writing a java app which monito...

C socket: problem with connect() and/or accept() between clients. 111: Connection refused

Hello ladies and gents, I'm having a bit of problem with accept(). I have a multiple clients and one server. The clients can connect and communicate just fine with server. But at one point, I need some clients to be directly connected to each other and I'm having a bit of difficulty there. The clients have bunch of threads going on, wher...

Finding an available network port on the machine

I'm trying to implement a simple FTP server (a variation of the EFTP protocol) in linux. When a client connects and sends the PASV command, the server should respond with a port number, so the client can connect to that port to transmit the file. How can the server choose a port number? Do I need to iterate through all the ports from 102...

What is the connect timeout for a socket on linux

Hi, I have a programming running on linux ubuntu which tries to connect to a server port using TCP. Can you please tell me how can I find out that is timeout value for a client socket connecting to a server socket for ubuntu? Thank you. ...

boost::asio and socket ownership

Hello I've two classes (Negotiator, Client), both has their own boost::asio::ip::tcp::socket. Is there a way to transfer socket object to Client after negotiation is finished. I'm looking forward to do something like that: boost::asio::ip::tcp::socket sock1(io); //... boost::asio::ip::tcp::socket sock2; sock2.assign(sock1); This...

Objective-C Socket Streams "Bad File Descriptor" (IPhone)

I'm trying to create a simple IRC client, purely for fun and to try and learn a bit more about socket programming in objective C. So I've looked at some sample code and I have no idea why I can't seem to send or receive message upon connecting. Firstly I connect to the server using the following code: if (![urlString isEqualToString:...

How to send\recive SslStream from TCP server in C#?

How to send\recive SslStream from TCP server in C#? I need a simple tutorial on baciks of TCP stream protection using Sockets, SSLStreams and simple TCP listrning server... Is there any such tutorial? Please, help ...

Is there any Example of PHP user to user chat on sockets?

Is there any Example of PHP user to user chat on sockets? ...

how to bind/connect multiple UDP socket

My initial UDP socket is binded to 127.0.0.1:9898. The first time that I get notified of incoming data by epoll/kqueue, I do recvfrom() and I fill a struct sockaddr called peer_name that contain the peer informations (ip:port). Then I create a new UPD socket using socket(), then I bind() this newly created socket to the same ip:port (...

How to open PHP socket onto some URL? (like www.ex.com:8080/mySock/)

How to open PHP socket onto some URL? (like www.ex.com:8080/mySock/) I want to send user to a user Chart Room 1 if ho goes to www.ex.com:8080/mySock/Chart1 and www.ex.com:8080/mySock/Chart2 to some other chart room if he goes into another (live php multy useres chart on sockets (Flash backend)) ...

C# to php translator

Is there a C# to php translator (capable of dealing with byte operations, TCPSockets)? ...

How do i program a simple IRC bot in python?

Hi every one. I need help writing a basic IRC bot that just connects to a channel.. is anyone able to explain me this? I have managed to get it to connect to the IRC server but i am unable to join a channel and log on. The code i have thus far is: import sockethost = 'irc.freenode.org' port = 6667 join_sock = socket.socket() join_sock.c...

Google Protocol Buffers with Objective-C and Java

Hi, I'm looking at setting up communication between an iPhone app and a Java based server and thought that google protocol buffers might be the way to go; however I've managed to get myself a bit confused and I'm not sure the best way to go about implementing this so I was hoping for a bit of friendly advice :) Should I set up the Java...

L-Soft LISTSERV TCPGUI Interface for PHP Creation

I'm trying to use LISTSERV's "API" in PHP. L-Soft calls this TCPGUI, and essentially, you can request data like over Telnet. To do this, I'm using PHP's TCP socket functions. Here's the C code provided by L-Soft: C: http://www.lsoft.com/manuals/16.0/htmlhelp/advanced%20topics/TCPGUI.html#2334328 I've provided the PHP conversion I'm us...

EOF error using recv in python

I am doing this in my code, HOST = '192.168.1.3' PORT = 50007 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect((HOST, PORT)) query_details = {"page" : page, "query" : query, "type" : type} s.send(str(query_details)) #data = eval(pickle.loads(s.recv(4096))) data = s.recv(16384) But I am continually gett...

How do i send a file with sockets in python?

Hi all, I am already familiar with python and socket usage and can send strings of text over these. But how would i go about sending, say, an MP3 file? ...