sockets

how do you fix the clients outgoing port number using php?

Hi there, I'm using php (the sockets extension) to handle sending and receiving xml files. I'd like to be able to fix the outgoing clients port number as the server has a set amount of incoming connections. I find that each time the php script is run it creates a new port number. The client side script I have so far is this:- send_me...

Implementing all portscanning techniques in C# / Creating raw low level packets in C#

I am trying to write a port scanner in C#. I did some research on port scanning methods. If you are interested, these are the links I found useful: http://www.cs.wright.edu/~pmateti/InternetSecurity/Lectures/Probing/index.html ^PPT Presentation^ http://www.auditmypc.com/freescan/readingroom/port_scanning.asp (old) NMAP ...

Asynchronous Sockets - Handling false socket.AcceptAsync values

The Socket class has a method .AcceptAsync which either returns true or false. I'd thought the false return value was an error condition, but in the samples Microsoft provide for Async sockets they call the callback function synchronously after checking for failure, as shown here: public void StartAccept(SocketAsyncEventArgs acceptEven...

Why can HTTP handle only one pending request per socket?

Being curious, I wonder why HTTP, by design, can only handle one pending request per socket. I understand that this limitation is because there is no 'Id' to associate a request to its response, so the only way to match a response with its request is to send the response on the same socket that sent the request. There would be no way to...

Sockets in Visual C#. Need Help!

Hi, I'm from the Urkraine, and have bad english, but anyway not sure if there is an answer on my question. I took example from [here][1] but i have exception that GZip magical number is not valid, why ? public long WriteUrl() { long num1 = 0; bool saveItAtCache = false; bool existsAtCache = false...

manually input in textbox and connected to the server

Right now, when i press the connect button i will be connected to the server by the default ip address and port number. clientSocket.Connect("127.0.0.1", 8888); I would like to create 2 textbox in the GUI , 1 for the IP address and 1 for port. So that user can manually key in the IP add and port. May i know how to do this. thanks. us...

Socket select() works in Windows and times out in Linux

I'm porting a windows network application to linux and faced a timeout problem with select call on linux. The following function blocks for the entire timeout value and returns while I checked with a packet sniffer that client has already sent the data. int recvTimeOutTCP( SOCKET socket, long sec, long usec ) { struct timeval timeout;...

Socket not disconnecting when connectivity changes

My chat application connects to a server and information is sent/received by the user. When the connection changes, such as 3g->wifi, wifi->3g, losing a data connection, etc, the socket sometimes stays connected for ages before disconnecting. During this time, it's impossible to tell if the connection is still active, it seems as if mess...

mdi parent form_close event wouldn't trigger mid children form_close event?

Hi: I am working on a c# project that has a mdi parent form hosting multiple mdi children form. In one of the children forms, I opened a socket and listening on the socket using tcpListner. I stop the tcpListner when user close that mdi childform. But when I close the mdi parent without close the mdi children form first, the tcpListner ...

Send and Recive file in socket programming in Linux with C/C++ (GCC)

I have a Server Client structure , both server and client can send and receive file. how to send and receive file in socket programming. one solution that I think is partition the file and send one by one segment, is there any library for file send and receive in Linux and C/C++? ...

Socket.Close doesn't really close tcp socket? (c#)

It seems that using socket.Close() for a tcp socket, doesn't fully close the socket. In the following example I'm trying to connect to example.com at port 9999, which is not opened, and after a short-timeout, I'm trying to close the socket. for (int i = 0; i < 200; i++) { Socket sock = new Socket(AddressFamily.InterNetwork, Sock...

Specify the outgoing IP address to use with TCPClient / Socket in C#

I've a server with several IP Addresses assigned to the network adapter. On that server is a client app to connect to another server app via TCPClient. For all outgoing communications my servers default IP address is being used, however for this one application I'd like the outgoing communication to be send out on another local IP addre...

general java server/client tutorial

im developing a multi-player card game that needs the clients to communicate with each other or a general server. i have never done this before so i need some direction or tutorial on how to achieve this. so far i have created the local, single person version of the game... ...

Transfer file over socket.

I found this code witch I tried and it works great but(!). I want to store the file in a folder that I will choose and also get it from a folder that I again will chose. Since the Sender get an argument then I suppose that if I give an argument like /home/user/test.txt then that's ok and it'll work out fine but I don't get how to store t...

SSL Client For Row Tcp/Ip in iphone

i want to make a client of SSL Server Socket in iphone but i cannot find any API in iPhone. i have valid certificate file with password ...

What's the best(easiest) way to transfer data on C/C++

Hey people! Currently I'm working on a C/C++ cross-platform client/server software. I'm very experienced developer when it comes to low level socket development. The problem with Berkley sockets/Winsock, is that you always have to make some kind of parser to get things right on the receiver side. I mean, you have to interpret data, and ...

my c++ client/server file exchange implementation is very slow...why?

Hi have implemented simple file exchange over a client/server connection in c++. Works fine except for the one problem that its so damn slow. This is my code: For sending the file: int send_file(int fd) { char rec[10]; struct stat stat_buf; fstat (fd, &stat_buf); int size=stat_buf.st_size; while(size > 0) { char buffer[1024]; ...

Get ip address in C language

I need to display all the ip addresses from my local computer, using C language. How this can be done? Thanks. ...

linux sockets and multithreading in C

I want to create a process running under linux that creates multiple threads, each thread writing their own data out to a receiving process over a UDP socket connection. For sizing, say I need to have up to one hundred of these threads all running simultaneously with threads coming and going. Is it better to have each thread open up it'...

Fire event from Async component in UI thread

I'm building a non-visual component in .Net 2.0. This component uses an asynchronous socket (BeginReceive, EndReceive etc). Asynchronous callbacks are called in the context of a worker thread created by the runtime. The component user shouldn't have to worry about multithreading (This is the main goal, what I want) The component user ca...