Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 06-23-2009, 05:56 PM
Member
 
Join Date: Oct 2008
Posts: 25
Rep Power: 0
Omarero is on a distinguished road
Default in server client remote how to kno the ip of the sender
i created a connection between two computers by constructing a socket with the ip of the target computer and the port like this

on the computer who issues the request
echoSocket = new Socket("192.168.1.69", 7);

on the computer who recieves the request
clientSocket = serverSocket.accept();


and it had worked and both computers can listen to the same socket, now i want to know on the computer who recieves the request the ip of the sender ?
Bookmark Post in Technorati
Reply With Quote
  #2 (permalink)  
Old 06-26-2009, 04:24 PM
Senior Member
 
Join Date: Jul 2007
Posts: 135
Rep Power: 0
brianhks will become famous soon enough
Default
On the Socket object the server gets after calling accept() there is a method getRemoteSocketAddress()
Bookmark Post in Technorati
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Remote SQL Server Connection saso1310 Database 2 05-15-2009 08:39 AM
How to create remote client to connect with MS Access? Constance New To Java 6 04-23-2009 10:55 AM
connecting to remote SQL server mahasarathi JavaServer Pages (JSP) and JSTL 2 04-04-2009 07:11 AM
Datagram Client and Server, client timer question saru88 Networking 1 10-05-2008 04:12 PM
Identify Client in Socket Client Server Application masadjie Networking 1 12-20-2007 10:18 AM


All times are GMT +2. The time now is 06:42 PM.



VBulletin, Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2009, Crawlability, Inc.
Copyright ©2006 - 2007, www.java-forums.org